public abstract class AbstractMessageParser<T extends HttpMessage> extends Object implements HttpMessageParser<T>
SessionInputBuffer.| Constructor and Description |
|---|
AbstractMessageParser(SessionInputBuffer buffer,
LineParser parser,
HttpParams params)
Deprecated.
|
AbstractMessageParser(SessionInputBuffer buffer,
LineParser lineParser,
MessageConstraints constraints)
Creates new instance of AbstractMessageParser.
|
| Modifier and Type | Method and Description |
|---|---|
T |
parse()
Generates an instance of
HttpMessage from the underlying data
source. |
static Header[] |
parseHeaders(SessionInputBuffer inbuffer,
int maxHeaderCount,
int maxLineLen,
LineParser parser)
Parses HTTP headers from the data receiver stream according to the generic
format as given in Section 3.1 of RFC 822, RFC-2616 Section 4 and 19.3.
|
static Header[] |
parseHeaders(SessionInputBuffer inbuffer,
int maxHeaderCount,
int maxLineLen,
LineParser parser,
List<CharArrayBuffer> headerLines)
Parses HTTP headers from the data receiver stream according to the generic
format as given in Section 3.1 of RFC 822, RFC-2616 Section 4 and 19.3.
|
@Deprecated public AbstractMessageParser(SessionInputBuffer buffer, LineParser parser, HttpParams params)
AbstractMessageParser(SessionInputBuffer,
LineParser, MessageConstraints)buffer - the session input buffer.parser - the line parser.params - HTTP parameters.public AbstractMessageParser(SessionInputBuffer buffer, LineParser lineParser, MessageConstraints constraints)
buffer - the session input buffer.lineParser - the line parser. If null BasicLineParser.INSTANCE
will be used.constraints - the message constraints. If null
MessageConstraints.DEFAULT will be used.public static Header[] parseHeaders(SessionInputBuffer inbuffer, int maxHeaderCount, int maxLineLen, LineParser parser) throws HttpException, IOException
inbuffer - Session input buffermaxHeaderCount - maximum number of headers allowed. If the number
of headers received from the data stream exceeds maxCount value, an
IOException will be thrown. Setting this parameter to a negative value
or zero will disable the check.maxLineLen - maximum number of characters for a header line,
including the continuation lines. Setting this parameter to a negative
value or zero will disable the check.parser - line parser to use. Can be null, in which case
the default implementation of this interface will be used.IOException - in case of an I/O errorHttpException - in case of HTTP protocol violationpublic static Header[] parseHeaders(SessionInputBuffer inbuffer, int maxHeaderCount, int maxLineLen, LineParser parser, List<CharArrayBuffer> headerLines) throws HttpException, IOException
inbuffer - Session input buffermaxHeaderCount - maximum number of headers allowed. If the number
of headers received from the data stream exceeds maxCount value, an
IOException will be thrown. Setting this parameter to a negative value
or zero will disable the check.maxLineLen - maximum number of characters for a header line,
including the continuation lines. Setting this parameter to a negative
value or zero will disable the check.parser - line parser to use.headerLines - List of header lines. This list will be used to store
intermediate results. This makes it possible to resume parsing of
headers in case of a InterruptedIOException.IOException - in case of an I/O errorHttpException - in case of HTTP protocol violationpublic T parse() throws IOException, HttpException
HttpMessageParserHttpMessage from the underlying data
source.parse in interface HttpMessageParser<T extends HttpMessage>IOException - in case of an I/O errorHttpException - in case of HTTP protocol violationCopyright © 2010 - 2020 Adobe. All Rights Reserved