Class HttpHeaderParser
- java.lang.Object
-
- org.apache.tomcat.util.http.parser.HttpHeaderParser
-
public class HttpHeaderParser extends java.lang.ObjectParses HTTP request and response headers from a byte buffer.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceHttpHeaderParser.HeaderDataSourceProvides access to the header data buffer for the parser.static classHttpHeaderParser.HeaderParsePositionPossible parser positions during header parsing.static classHttpHeaderParser.HeaderParseStatusPossible return values fromparseHeader().
-
Constructor Summary
Constructors Constructor Description HttpHeaderParser(HttpHeaderParser.HeaderDataSource source, MimeHeaders headers, boolean tolerantEol)Creates a new header parser.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description HttpHeaderParser.HeaderParseStatusparseHeader()Parse an HTTP header.voidrecycle()Resets the parser state for reuse.
-
-
-
Constructor Detail
-
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 Detail
-
recycle
public void recycle()
Resets the parser state for reuse.
-
parseHeader
public HttpHeaderParser.HeaderParseStatus parseHeader() throws java.io.IOException
Parse an HTTP header.- Returns:
- One of
HttpHeaderParser.HeaderParseStatus.NEED_MORE_DATA,HttpHeaderParser.HeaderParseStatus.HAVE_MORE_HEADERSorHttpHeaderParser.HeaderParseStatus.DONE. - Throws:
java.io.IOException- If an error occurs during the parsing of the headers
-
-