|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.webbitserver.wrapper.HttpResponseWrapper
public class HttpResponseWrapper
| Constructor Summary | |
|---|---|
HttpResponseWrapper(HttpResponse response)
|
|
| Method Summary | |
|---|---|
Charset |
charset()
Current Charset used to encode to response as. |
HttpResponseWrapper |
charset(Charset charset)
For text based responses, sets the Charset to encode the response as. |
boolean |
containsHeader(String name)
Test to see if this response has a header of the specified name |
HttpResponseWrapper |
content(byte[] content)
Write binary based content back to the client. |
HttpResponseWrapper |
content(ByteBuffer buffer)
Write binary based content back to the client. |
HttpResponseWrapper |
content(String content)
Write text based content back to the client. |
HttpResponseWrapper |
cookie(HttpCookie httpCookie)
Adds a cookie |
HttpResponseWrapper |
end()
Marks the response as ended. |
HttpResponseWrapper |
error(Throwable error)
Marks the response as erroneous. |
HttpResponseWrapper |
header(String name,
Date value)
Adds a Date (RFC 1123 format) HTTP header. |
HttpResponseWrapper |
header(String name,
long value)
Adds a numeric HTTP header. |
HttpResponseWrapper |
header(String name,
String value)
Adds an HTTP header. |
HttpResponse |
originalResponse()
|
int |
status()
Retrieve HTTP status code that this response is going to return. |
HttpResponseWrapper |
status(int status)
Sets the HTTP status code. |
HttpResponse |
underlyingResponse()
|
HttpResponseWrapper |
underlyingResponse(HttpResponse response)
|
HttpResponseWrapper |
write(String content)
Writes immediately to the client without closing the connection. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public HttpResponseWrapper(HttpResponse response)
| Method Detail |
|---|
public HttpResponse underlyingResponse()
public HttpResponseWrapper underlyingResponse(HttpResponse response)
public HttpResponse originalResponse()
public HttpResponseWrapper charset(Charset charset)
HttpResponse
charset in interface HttpResponsepublic Charset charset()
HttpResponse
charset in interface HttpResponseHttpResponse.charset(Charset)public HttpResponseWrapper status(int status)
HttpResponse
status in interface HttpResponsepublic int status()
HttpResponse
status in interface HttpResponseHttpResponse.status(int)
public HttpResponseWrapper header(String name,
String value)
HttpResponse
header in interface HttpResponse
public HttpResponseWrapper header(String name,
long value)
HttpResponse
header in interface HttpResponsepublic HttpResponseWrapper cookie(HttpCookie httpCookie)
HttpResponse
cookie in interface HttpResponsehttpCookie - the cookiepublic HttpResponseWrapper content(String content)
HttpResponse
content in interface HttpResponseHttpResponse.charset(Charset),
HttpResponse.content(byte[])public HttpResponseWrapper write(String content)
HttpResponseHttpResponse.content(String) method caches content until HttpResponse.end() is called()
TODO: Make content write immediately instead and remove this method?
write in interface HttpResponsecontent - what to writepublic HttpResponseWrapper content(byte[] content)
HttpResponse
content in interface HttpResponseHttpResponse.content(String)public HttpResponseWrapper content(ByteBuffer buffer)
HttpResponse
content in interface HttpResponseHttpResponse.content(String)public HttpResponseWrapper error(Throwable error)
HttpResponseHttpResponse.end() or HttpResponse.error(Throwable) called. No more
operations should be performed on a response after these.
error in interface HttpResponsepublic HttpResponseWrapper end()
HttpResponseHttpResponse.end() or HttpResponse.error(Throwable) called. No more
operations should be performed on a response after these.
end in interface HttpResponse
public HttpResponseWrapper header(String name,
Date value)
HttpResponse
header in interface HttpResponsepublic boolean containsHeader(String name)
HttpResponse
containsHeader in interface HttpResponse
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||