public abstract class HeaderConsumer extends SegmentConsumer implements Header
HeaderConsumer
object is used to consume a HTTP
header from the cursor. This extends the segment consumer with
methods specific to the header. Also this enables session cookies
to be created using the cookies extracted from the header.cookies, disposition, encoding, expect, header, language, length, limit, name, pos, scan, type, value
array, chunk, count, done
Modifier | Constructor and Description |
---|---|
protected |
HeaderConsumer()
Constructor for the
HeaderConsumer object. |
Modifier and Type | Method and Description |
---|---|
Cookie |
getCookie(String name)
This is used to acquire a cookie using the name of that cookie.
|
List<Cookie> |
getCookies()
This is used to acquire all cookies that were sent in the header.
|
long |
getDate(String name)
This can be used to get the date of the first message header
that has the specified name.
|
int |
getInteger(String name)
This can be used to get the integer of the first message header
that has the specified name.
|
List<String> |
getNames()
This method is used to get a
List of the names
for the headers. |
add, adjust, cookie, disposition, encoding, end, equal, expect, getContentLength, getContentType, getDisposition, getFileName, getLocales, getName, getTransferEncoding, getValue, getValue, getValues, headers, isExpectContinue, isFile, language, length, process, resize, scan, space, terminal, toString, type, white
consume, isFinished
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getAddress, getHeader, getLocales, getMajor, getMethod, getMinor, getPath, getQuery, getTarget, isExpectContinue, toString
getContentLength, getContentType, getDisposition, getFileName, getName, getTransferEncoding, getValue, getValue, getValues, isFile
protected HeaderConsumer()
HeaderConsumer
object. This
is used to create a consumer capable of reading a header from
a provided cursor. All methods of the Header
interface are implemented in this object.
public long getDate(String name)
public int getInteger(String name)
getInteger
in interface Header
name
- the HTTP message header to get the value frompublic List<String> getNames()
List
of the names
for the headers. This will provide the original names for the
HTTP headers for the message. Modifications to the provided
list will not affect the header, the list is a simple copy.public Cookie getCookie(String name)
Cookie
object. Otherwise this method will
return null. Each cookie object will contain the name, value
and path of the cookie as well as the optional domain part.public List<Cookie> getCookies()
Cookie
objects. Otherwise this method will an
empty list. Each cookie object will contain the name, value and
path of the cookie as well as the optional domain part.getCookies
in interface Header
Copyright © 2015. All rights reserved.