public class HttpHeader extends PayloadWithHeaderAbstract
| Modifier and Type | Field and Description |
|---|---|
protected static java.lang.String |
CONTENT_TYPE
Content-type header name.
|
java.lang.String |
contentType
HTTP content Content-type.
|
protected java.util.List<HeaderLine> |
headerList
List of parsed header fields.
|
protected java.util.Map<java.lang.String,HeaderLine> |
headerMap
Map of parsed header fields.
|
int |
headerType
Header type of this object.
|
static int |
HT_REQUEST
Request header type.
|
static int |
HT_RESPONSE
Response header type.
|
protected static java.lang.String |
HTTP_VERSION_SUFFIX
HTTP Version suffix.
|
java.lang.String |
httpVersion
HTTP-Version.
|
java.lang.Integer |
httpVersionMajor
HTTP-Version major.
|
java.lang.Integer |
httpVersionMinor
HTTP-Version minor.
|
java.lang.String |
method
HTTP Method.
|
static java.lang.String |
PROTOCOL_HTTP
HTTP scheme.
|
static java.lang.String |
PROTOCOL_HTTPS
HTTPS scheme.
|
java.lang.String |
reasonPhrase
HTTP Reason-Phrase.
|
java.lang.String |
requestUri
HTTP Request-URI.
|
java.lang.Integer |
statusCode
HTTP Status-Code.
|
java.lang.String |
statusCodeStr
HTTP Status-Code.
|
bClosed, bIsValid, bNoSuchAlgorithmException, diagnostics, digest, digestAlgorithm, header, in_complete, in_digest, in_flr, in_payload, in_pb, in_pb_exposed, md, payloadLength, totalLength| Modifier | Constructor and Description |
|---|---|
protected |
HttpHeader()
Non public constructor.
|
| Modifier and Type | Method and Description |
|---|---|
HeaderLine |
getHeader(java.lang.String field)
Get a header line structure or null, if no header line structure is
stored with the given header name.
|
java.util.List<HeaderLine> |
getHeaderList()
Get a
List of all the headers found during parsing. |
java.lang.String |
getProtocolContentType()
Content-Type getter
|
java.lang.Integer |
getProtocolStatusCode()
Result-Code integer getter
|
java.lang.String |
getProtocolStatusCodeStr()
Result-Code string getter
|
java.lang.String |
getProtocolVersion()
protocolVersion getter
|
protected boolean |
isHttpRequestLineValid(java.lang.String requestLine)
Checks a HTTP Request Request-Line for validity.
|
protected boolean |
isHttpStatusLineValid(java.lang.String statusLine)
Checks a HTTP Response Status-Line for validity.
|
protected boolean |
isHttpVersionValid(java.lang.String versionString)
Checks a HTTP-Version string for validity.
|
static boolean |
isSupported(java.lang.String protocol)
Boolean indicating whether a protocol is supported by this
payload inspector.
|
static HttpHeader |
processPayload(int headerType,
ByteCountingPushBackInputStream pbin,
long length,
java.lang.String digestAlgorithm)
Reads the HTTP protocol response or request and returns it as an object.
|
protected boolean |
readHeader(MaxLengthRecordingInputStream in,
long payloadLength)
Reads the header and updates the payloadLength field if the header is valid.
|
java.lang.String |
toString() |
close, getDigest, getHeader, getInputStreamComplete, getPayloadInputStream, getPayloadLength, getRemaining, getTotalLength, getUnavailable, initProcess, isClosed, isValidpublic static final int HT_RESPONSE
public static final int HT_REQUEST
public static final java.lang.String PROTOCOL_HTTP
public static final java.lang.String PROTOCOL_HTTPS
protected static final java.lang.String HTTP_VERSION_SUFFIX
protected static final java.lang.String CONTENT_TYPE
public int headerType
public java.lang.String method
public java.lang.String requestUri
public java.lang.String httpVersion
public java.lang.Integer httpVersionMajor
public java.lang.Integer httpVersionMinor
public java.lang.String statusCodeStr
public java.lang.Integer statusCode
public java.lang.String reasonPhrase
protected java.util.List<HeaderLine> headerList
protected java.util.Map<java.lang.String,HeaderLine> headerMap
public java.lang.String contentType
protected HttpHeader()
public static boolean isSupported(java.lang.String protocol)
protocol - protocol namepublic static HttpHeader processPayload(int headerType, ByteCountingPushBackInputStream pbin, long length, java.lang.String digestAlgorithm) throws java.io.IOException
headerType - HTTP header type to parse, request or responsepbin - payload input streamlength - payload lengthdigestAlgorithm - digest algorithm to use on payload or null if we
don't want a digest of the payloadHttpResponse based on the http headersjava.io.IOException - if an error occur while processing http header.protected boolean readHeader(MaxLengthRecordingInputStream in, long payloadLength) throws java.io.IOException
PayloadWithHeaderAbstractreadHeader in class PayloadWithHeaderAbstractin - the input stream to parse.payloadLength - the record length.java.io.IOException - I/O exception while reading headersprotected boolean isHttpStatusLineValid(java.lang.String statusLine)
statusLine - the Status-Line of the HTTP Responseprotected boolean isHttpVersionValid(java.lang.String versionString)
versionString - the HTTP-Version of the HTTP headerprotected boolean isHttpRequestLineValid(java.lang.String requestLine)
requestLine - the Request-Line of the HTTP Requestpublic java.util.List<HeaderLine> getHeaderList()
PayloadWithHeaderAbstractList of all the headers found during parsing.getHeaderList in class PayloadWithHeaderAbstractList of HeaderLinepublic HeaderLine getHeader(java.lang.String field)
PayloadWithHeaderAbstractgetHeader in class PayloadWithHeaderAbstractfield - header nameHeaderLine structure or nullpublic java.lang.String getProtocolStatusCodeStr()
public java.lang.Integer getProtocolStatusCode()
public java.lang.String getProtocolVersion()
public java.lang.String getProtocolContentType()
public java.lang.String toString()
toString in class java.lang.ObjectCopyright © 2011–2023. All rights reserved.