|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.radekzitek.userver.http.HttpMessage
Class representing any of the two types of HTTP messages - request and response.
| Field Summary | |
protected byte[] |
body
Budy of the message in a byte array. |
private static byte[] |
CRLF
CRLF |
protected java.util.Hashtable |
headers
Message headers. |
private boolean |
headResponse
Used to flag that the message is response to a HEAD. |
private static org.apache.log4j.Logger |
LOG
Log4j logger. |
protected HttpStartLine |
startLine
Startline of the message. |
protected java.util.Hashtable |
trailers
Message trailers. |
| Constructor Summary | |
HttpMessage()
Default contructor of the HttpMassage creates an empty message. |
|
| Method Summary | |
void |
clear()
Empties the message content. |
byte[] |
getBody()
Gets the body of the message. |
long |
getBodyLength()
Based on the start line and headers returns the expected length of the message body. |
HttpHeader |
getHeader(java.lang.String fieldName)
Retrieves an individual header of the message. |
java.util.Hashtable |
getHeaders()
Retrieves all headers of the message. |
HttpHeader |
getTrailer(java.lang.String fieldName)
Retrieves individual trailer from the message. |
java.util.Hashtable |
getTrailers()
Retrieves all trailers of the message. |
boolean |
isBodyless()
|
boolean |
isChunked()
|
boolean |
isHeadResponse()
|
HttpHeader |
putHeader(HttpHeader header)
Puts individual header into the message. |
HttpHeader |
putTrailer(HttpHeader trailer)
Puts individual trailer into the message. |
void |
setBody(byte[] body)
Sets the body byte array. |
void |
setHeaders(java.util.Hashtable headers)
Sets the headers hashtable. |
void |
setHeadResponse(boolean headResponse)
|
void |
setTrailers(java.util.Hashtable trailers)
Sets the trailes hashtable. |
boolean |
shouldClose()
|
java.lang.String |
toString()
Returns String representation of the mssage. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
private static final byte[] CRLF
private boolean headResponse
private static final org.apache.log4j.Logger LOG
protected byte[] body
protected java.util.Hashtable headers
protected HttpStartLine startLine
protected java.util.Hashtable trailers
| Constructor Detail |
public HttpMessage()
| Method Detail |
public void clear()
public byte[] getBody()
public HttpHeader getHeader(java.lang.String fieldName)
fieldName - Name of the header to be retrieved.
public java.util.Hashtable getHeaders()
public HttpHeader getTrailer(java.lang.String fieldName)
fieldName - Name of the trailer to be retrieved.
public java.util.Hashtable getTrailers()
public HttpHeader putHeader(HttpHeader header)
header - The header to be included in the message.
public HttpHeader putTrailer(HttpHeader trailer)
trailer - The trailer to be included in the message.
public void setBody(byte[] body)
body - The body to set.public void setHeaders(java.util.Hashtable headers)
headers - The headers to set.public void setTrailers(java.util.Hashtable trailers)
trailers - The trailers to set.public java.lang.String toString()
public long getBodyLength()
public boolean isChunked()
public boolean isBodyless()
public boolean shouldClose()
public boolean isHeadResponse()
public void setHeadResponse(boolean headResponse)
headResponse - The headResponse to set.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||