|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.officefloor.plugin.socket.server.http.parse.impl.HttpRequestParserImpl
public class HttpRequestParserImpl
Parser for a HTTP request.
| Field Summary | |
|---|---|
static Charset |
US_ASCII
|
| Constructor Summary | |
|---|---|
HttpRequestParserImpl(int maxHeaderCount,
long maxBodyLength)
Initiate. |
|
| Method Summary | |
|---|---|
InputBufferStream |
getBody()
Obtains the InputBufferStream to the body of the
HttpRequest. |
List<HttpHeader> |
getHeaders()
Obtains the HttpHeader instances in the order supplied. |
String |
getHttpVersion()
Obtains the HTTP version. |
String |
getMethod()
Obtains the method. |
String |
getRequestURI()
Obtains the request URI. |
boolean |
parse(InputBufferStream inputBufferStream,
char[] tempBuffer)
Parses the HttpRequest bytes from the InputBufferStream. |
void |
reset()
Resets for parsing another HttpRequest. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final Charset US_ASCII
| Constructor Detail |
|---|
public HttpRequestParserImpl(int maxHeaderCount,
long maxBodyLength)
maxHeaderCount - Maximum number of HttpHeader instances for a
HttpRequest.maxBodyLength - Maximum length of the body buffer. Requests with bodies
greater that this will fail parsing.| Method Detail |
|---|
public void reset()
HttpRequestParserHttpRequest.
reset in interface HttpRequestParser
public boolean parse(InputBufferStream inputBufferStream,
char[] tempBuffer)
throws IOException,
HttpRequestParseException
HttpRequestParserHttpRequest bytes from the InputBufferStream.
parse in interface HttpRequestParserinputBufferStream - InputBufferStream containing the data to be parsed for
the HttpRequest.tempBuffer - Temporary char buffer that is used to translate bytes into a
String. This allows reducing memory size and creation
of arrays. The size of the buffer indicates the maximum size
for parts of the HttpRequest (except the body).
true if the HttpRequest has been fully
parsed. InputBufferStream to obtain the full HttpRequest.
IOException - If fails to read bytes.
HttpRequestParseException - If failure to parse HttpRequest.public String getMethod()
HttpRequestParser
getMethod in interface HttpRequestParserpublic String getRequestURI()
HttpRequestParser
getRequestURI in interface HttpRequestParserpublic String getHttpVersion()
HttpRequestParser
getHttpVersion in interface HttpRequestParserpublic List<HttpHeader> getHeaders()
HttpRequestParserHttpHeader instances in the order supplied.
getHeaders in interface HttpRequestParserHttpHeader instances in the order supplied.public InputBufferStream getBody()
HttpRequestParserInputBufferStream to the body of the
HttpRequest.
getBody in interface HttpRequestParserInputBufferStream to the body of the HttpRequest.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||