public class HttpResponseParser extends AbstractMessageParser
SessionInputBuffer
.lineParser
Constructor and Description |
---|
HttpResponseParser(SessionInputBuffer buffer,
LineParser parser,
HttpResponseFactory responseFactory,
HttpParams params)
Creates an instance of this class.
|
Modifier and Type | Method and Description |
---|---|
protected HttpMessage |
parseHead(SessionInputBuffer sessionBuffer)
Subclasses must override this method to generate an instance of
HttpMessage based on the initial input from the session buffer. |
parse, parseHeaders
public HttpResponseParser(SessionInputBuffer buffer, LineParser parser, HttpResponseFactory responseFactory, HttpParams params)
The following HTTP parameters affect the initialization:
CoreConnectionPNames.MAX_HEADER_COUNT
parameter determines
the maximum HTTP header count allowed. If set to a positive value,
the number of HTTP headers received from the data stream exceeding
this limit will cause an IOException. A negative or zero value will
effectively disable the check. Per default the check is disabled.
CoreConnectionPNames.MAX_LINE_LENGTH
parameter determines
the maximum line length limit. If set to a positive value, any HTTP line
exceeding this limit will cause an IOException. A negative or zero value
will effectively disable the check the check. Per default the check is
disabled.
buffer
- the session input buffer.parser
- the line parser.responseFactory
- the factory to use to create
HttpResponse
s.params
- HTTP parameters.protected HttpMessage parseHead(SessionInputBuffer sessionBuffer) throws java.io.IOException, HttpException, ParseException
AbstractMessageParser
HttpMessage
based on the initial input from the session buffer.
Usually this method is expected to read just the very first line or
the very first valid from the data stream and based on the input generate
an appropriate instance of HttpMessage
.
parseHead
in class AbstractMessageParser
sessionBuffer
- the session input buffer.java.io.IOException
- in case of an I/O error.HttpException
- in case of HTTP protocol violation.ParseException
- in case of a parse error.