Class HttpHeaderParser
java.lang.Object
org.apache.tomcat.util.http.parser.HttpHeaderParser
Parses HTTP request and response headers from a byte buffer.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceProvides access to the header data buffer for the parser.static enumPossible parser positions during header parsing.static enumPossible return values fromparseHeader(). -
Constructor Summary
ConstructorsConstructorDescriptionHttpHeaderParser(HttpHeaderParser.HeaderDataSource source, MimeHeaders headers, boolean tolerantEol) Creates a new header parser. -
Method Summary
Modifier and TypeMethodDescriptionParse an HTTP header.voidrecycle()Resets the parser state for reuse.
-
Constructor Details
-
HttpHeaderParser
public HttpHeaderParser(HttpHeaderParser.HeaderDataSource source, MimeHeaders headers, boolean tolerantEol) Creates a new header parser.- Parameters:
source- The data source for header bytesheaders- The mime headers to populatetolerantEol- Whether to tolerate non-standard line endings
-
-
Method Details
-
recycle
public void recycle()Resets the parser state for reuse. -
parseHeader
Parse an HTTP header.- Returns:
- One of
HttpHeaderParser.HeaderParseStatus.NEED_MORE_DATA,HttpHeaderParser.HeaderParseStatus.HAVE_MORE_HEADERSorHttpHeaderParser.HeaderParseStatus.DONE. - Throws:
IOException- If an error occurs during the parsing of the headers
-