public class Response extends Message
| Modifier and Type | Class and Description |
|---|---|
static class |
Response.ResponseBuilder |
| Constructor and Description |
|---|
Response() |
addObserver, containsObserver, createMessageSnapshot, discardBody, getBody, getBodyAsStream, getBodyAsStreamDecoded, getBodyAsStringDecoded, getCharset, getErrorMessage, getHeader, getVersion, hasMsgReleased, isCSS, isDeflate, isGzip, isHTML, isHTTP10, isHTTP11, isImage, isJavaScript, isJSON, isReleased, isXML, readBody, release, setBody, setBodyContent, setErrorMessage, setHeader, setReleased, setVersion, toString, write, writeStartLinepublic static Response.ResponseBuilder ok(String msg) throws Exception
Exceptionpublic static Response.ResponseBuilder ok()
public static Response.ResponseBuilder noContent()
public static Response.ResponseBuilder notModified(String date)
public static Response.ResponseBuilder badRequest()
public static Response.ResponseBuilder badRequest(String message)
public static Response.ResponseBuilder badRequest(String message, boolean escape)
public static Response.ResponseBuilder continue100()
public static Response.ResponseBuilder redirect(String uri, boolean permanent)
public static Response.ResponseBuilder redirectGet(String uri)
public static Response.ResponseBuilder redirectWithout300(String uri)
public static Response.ResponseBuilder redirectWithout300(String uri, String body)
public static Response.ResponseBuilder serverUnavailable(String message)
public static Response.ResponseBuilder internalServerError()
public static Response.ResponseBuilder internalServerError(String message)
public static Response.ResponseBuilder badGateway(String message)
public static Response.ResponseBuilder gatewayTimeout(String message)
public static Response.ResponseBuilder forbidden()
public static Response.ResponseBuilder notFound()
public static Response.ResponseBuilder forbidden(String message)
public static Response.ResponseBuilder unauthorized(String message)
public static Response.ResponseBuilder unauthorized()
public String getStartLine()
getStartLine in class Messagepublic int getStatusCode()
public void setStatusCode(int statusCode)
public String getStatusMessage()
public void setStatusMessage(String statusMessage)
public void parseStartLine(InputStream in) throws IOException, EndOfStreamException
parseStartLine in class MessageIOExceptionEndOfStreamExceptionpublic void read(InputStream in, boolean createBody) throws IOException, EndOfStreamException
Messageread in class MessageIOExceptionEndOfStreamExceptionprotected void createBody(InputStream in) throws IOException
createBody in class MessageIOExceptionpublic boolean isRedirect()
public boolean hasNoContent()
public boolean isBodyEmpty()
throws IOException
isBodyEmpty in class MessageIOExceptionpublic boolean isOk()
public boolean isUserError()
public boolean isServerError()
public boolean isKeepAlive()
isKeepAlive in class Messagepublic int estimateHeapSize()
estimateHeapSize in class Messagepublic <T extends Message> T createSnapshot() throws Exception
createSnapshot in class MessageExceptionCopyright © 2021. All Rights Reserved.