public EntityProviderResponseContext(EntityProvider provider, Abdera abdera) { super(abdera); this.provider = provider; init(); }
/** * Return a 204 No Content response */ public static ResponseContext nocontent(String reason) { return new EmptyResponseContext(204, reason); }
public MediaResponseContext(InputStream in, EntityTag etag, int status) { this.in = in; this.status = status; setEntityTag(etag); }
public ResponseContext setExpires(Date date) { return date == null ? removeHeader("Expires") : setHeader("Expires", date); }
public void writeTo(Writer writer) throws IOException { if (hasEntity()) writeEntity(writer); }
public EmptyResponseContext(int status, String text) { setStatus(status); setStatusText(text); }
public ResponseContext setAllow(String method) { return setHeader("Allow", method); }
public MediaResponseContext(InputStream in, Date lastmodified, int status) { this.in = in; this.status = status; setLastModified(lastmodified); }
public EmptyResponseContext(int status) { setStatus(status); }
public ResponseContext setContentType(String type) { return setContentType(type, null); }
public ResponseContext addHeader(String name, Object value) { return addHeaders(name, new Object[] {value}); }
public RequestContext setAttribute(String name, Object value) { return setAttribute(Scope.REQUEST, name, value); }
public ResponseContextException(int responseCode, Throwable t) { this(new EmptyResponseContext(responseCode), t); }
public ResponseContext setContentLocation(String uri) { return uri == null ? removeHeader("Content-Location") : setHeader("Content-Location", uri); }
public EntityProviderResponseContext(EntityProvider provider, Abdera abdera, String encoding, String sw) { super(abdera, encoding, sw); this.provider = provider; init(); }
public ResponseContext setHeader(String name, Object value) { return setHeader(name, new Object[] {value}); }
public ResponseContextException(int responseCode) { this(new EmptyResponseContext(responseCode)); }
public ResponseContext setLastModified(Date date) { return date == null ? removeHeader("Last-Modified") : setHeader("Last-Modified", date); }
public EntityProviderResponseContext(EntityProvider provider, Abdera abdera, String encoding) { super(abdera, encoding); this.provider = provider; init(); }
public ResponseContext setLocation(String uri) { return uri == null ? removeHeader("Location") : setHeader("Location", uri); }