Package kilim.http
Class HttpResponse
java.lang.Object
kilim.http.HttpMsg
kilim.http.HttpResponse
The response object encapsulates the header and often, but not always, the content. The caller must set all the
fields, except for the protocol, server and date. The body of the response (the content) is written to a stream
obtained from
getOutputStream().-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic ConcurrentHashMap<String, byte[]> static final byte[]static final byte[]static final byte[]static final byte[]static final SimpleDateFormatstatic final byte[]static final byte[]static final byte[]static final byte[]static final byte[]static final byte[]static final byte[]static final byte[]static final byte[]static final byte[]static final byte[]static final byte[]static final byte[]static final byte[]static final byte[]static final byte[]static final byte[]static final byte[]static final byte[]static final byte[]static final byte[]static final byte[]static final byte[]static final byte[]static final byte[]static final byte[]static final byte[]static final byte[]static final byte[]static final byte[]static final byte[]static final byte[]static final byte[]static final byte[]static final byte[]static final byte[]static final byte[]static final byte[]static final byte[]static final byte[]static final byte[]static final byte[]byte[]The status line for the response. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetHeaderValue(String key) voidreuse()voidsetContentLength(long length) voidsetContentType(String contentType) voidvoidvoid
-
Field Details
-
ST_CONTINUE
public static final byte[] ST_CONTINUE -
ST_SWITCHING_PROTOCOLS
public static final byte[] ST_SWITCHING_PROTOCOLS -
ST_OK
public static final byte[] ST_OK -
ST_CREATED
public static final byte[] ST_CREATED -
ST_ACCEPTED
public static final byte[] ST_ACCEPTED -
ST_NON_AUTHORITATIVE
public static final byte[] ST_NON_AUTHORITATIVE -
ST_NO_CONTENT
public static final byte[] ST_NO_CONTENT -
ST_RESET_CONTENT
public static final byte[] ST_RESET_CONTENT -
ST_PARTIAL_CONTENT
public static final byte[] ST_PARTIAL_CONTENT -
ST_MULTIPLE_CHOICES
public static final byte[] ST_MULTIPLE_CHOICES -
ST_MOVED_PERMANENTLY
public static final byte[] ST_MOVED_PERMANENTLY -
ST_FOUND
public static final byte[] ST_FOUND -
ST_SEE_OTHER
public static final byte[] ST_SEE_OTHER -
ST_NOT_MODIFIED
public static final byte[] ST_NOT_MODIFIED -
ST_USE_PROXY
public static final byte[] ST_USE_PROXY -
ST_TEMPORARY_REDIRECT
public static final byte[] ST_TEMPORARY_REDIRECT -
ST_BAD_REQUEST
public static final byte[] ST_BAD_REQUEST -
ST_UNAUTHORIZED
public static final byte[] ST_UNAUTHORIZED -
ST_PAYMENT_REQUIRED
public static final byte[] ST_PAYMENT_REQUIRED -
ST_FORBIDDEN
public static final byte[] ST_FORBIDDEN -
ST_NOT_FOUND
public static final byte[] ST_NOT_FOUND -
ST_METHOD_NOT_ALLOWED
public static final byte[] ST_METHOD_NOT_ALLOWED -
ST_NOT_ACCEPTABLE
public static final byte[] ST_NOT_ACCEPTABLE -
ST_PROXY_AUTHENTICATION_REQUIRED
public static final byte[] ST_PROXY_AUTHENTICATION_REQUIRED -
ST_REQUEST_TIMEOUT
public static final byte[] ST_REQUEST_TIMEOUT -
ST_CONFLICT
public static final byte[] ST_CONFLICT -
ST_GONE
public static final byte[] ST_GONE -
ST_LENGTH_REQUIRED
public static final byte[] ST_LENGTH_REQUIRED -
ST_PRECONDITION_FAILED
public static final byte[] ST_PRECONDITION_FAILED -
ST_REQUEST_ENTITY_TOO_LARGE
public static final byte[] ST_REQUEST_ENTITY_TOO_LARGE -
ST_REQUEST_URI_TOO_LONG
public static final byte[] ST_REQUEST_URI_TOO_LONG -
ST_UNSUPPORTED_MEDIA_TYPE
public static final byte[] ST_UNSUPPORTED_MEDIA_TYPE -
ST_REQUEST_RANGE_NOT_SATISFIABLE
public static final byte[] ST_REQUEST_RANGE_NOT_SATISFIABLE -
ST_EXPECTATION_FAILED
public static final byte[] ST_EXPECTATION_FAILED -
ST_TEAPOT
public static final byte[] ST_TEAPOT -
ST_INTERNAL_SERVER_ERROR
public static final byte[] ST_INTERNAL_SERVER_ERROR -
ST_NOT_IMPLEMENTED
public static final byte[] ST_NOT_IMPLEMENTED -
ST_BAD_GATEWAY
public static final byte[] ST_BAD_GATEWAY -
ST_SERVICE_UNAVAILABLE
public static final byte[] ST_SERVICE_UNAVAILABLE -
ST_GATEWAY_TIMEOUT
public static final byte[] ST_GATEWAY_TIMEOUT -
ST_HTTP_VERSION_NOT_SUPPORTED
public static final byte[] ST_HTTP_VERSION_NOT_SUPPORTED -
PROTOCOL
public static final byte[] PROTOCOL -
F_SERVER
public static final byte[] F_SERVER -
F_DATE
public static final byte[] F_DATE -
CRLF
public static final byte[] CRLF -
FIELD_SEP
public static final byte[] FIELD_SEP -
byteCache
-
status
public byte[] statusThe status line for the response. Can use any of the predefined strings in HttpResponse.ST_*. -
keys
-
values
-
bodyStream
-
gmtdf
-
-
Constructor Details
-
HttpResponse
public HttpResponse() -
HttpResponse
public HttpResponse(byte[] statusb) -
HttpResponse
-
-
Method Details
-
reuse
public void reuse() -
setStatus
-
addField
-
getHeaderValue
-
writeHeader
- Throws:
IOException
-
getOutputStream
-
writeTo
- Throws:
IOExceptionPausable
-
setContentLength
public void setContentLength(long length) -
setContentType
-