|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object ikrs.httpd.HTTPHeaders
public class HTTPHeaders
This class wraps HTTPHeaderLines together into a list like searchable structure.
Field Summary | |
---|---|
static java.lang.String |
NAME_ACCEPT
|
static java.lang.String |
NAME_ACCEPT_CHARSET
|
static java.lang.String |
NAME_ACCEPT_ENCODING
|
static java.lang.String |
NAME_ACCEPT_LANGUAGE
|
static java.lang.String |
NAME_ALLOW
|
static java.lang.String |
NAME_CONNECTION
|
static java.lang.String |
NAME_CONTENT_DISPOSITION
|
static java.lang.String |
NAME_CONTENT_LENGTH
|
static java.lang.String |
NAME_CONTENT_RANGE
|
static java.lang.String |
NAME_CONTENT_TYPE
|
static java.lang.String |
NAME_COOKIE
|
static java.lang.String |
NAME_HOST
|
static java.lang.String |
NAME_REFERER
|
static java.lang.String |
NAME_USER_AGENT
|
static java.lang.String |
NAME_WWW_AUTHENTICATE
|
Constructor Summary | |
---|---|
HTTPHeaders()
Creates a new and empty HTTPHeaders instance. |
Method Summary | |
---|---|
boolean |
add(HTTPHeaderLine e)
This method adds a new header line to this headers object. |
boolean |
add(HTTPHeaderLine e,
boolean replaceIfExists)
|
boolean |
add(java.lang.String key,
java.lang.String value)
This method adds a new header line to this headers object. |
HTTPHeaderLine |
get(int index)
|
HTTPHeaderLine |
get(java.lang.String name)
This method returns a random header line with the given key or null if no such element can be found. |
java.util.Set<HTTPHeaderLine> |
getAll(java.lang.String name)
This method returns a set containing all header lines with the given key (name). |
java.lang.Long |
getLongValue(java.lang.String key)
|
java.lang.String |
getRequestMethod()
|
java.lang.String |
getRequestProtocol()
|
java.lang.String |
getRequestURI()
|
java.lang.String |
getRequestVersion()
|
java.lang.String |
getResponseReasonPhrase()
|
java.lang.String |
getResponseStatus()
|
java.lang.String |
getStringValue(java.lang.String key)
|
boolean |
isGETRequest()
This method checks if the headers represent a HTTP GET request. |
boolean |
isHEADRequest()
This method checks if the headers represent a HTTP HEAD request. |
boolean |
isOPTIONSRequest()
This method checks if the headers represent a HTTP OPTIONS request. |
boolean |
isPOSTRequest()
This method checks if the headers represent a HTTP POST request. |
boolean |
isTRACERequest()
This method checks if the headers represent a HTTP TRACE request. |
java.util.Iterator<HTTPHeaderLine> |
iterator()
|
static HTTPHeaders |
read(java.io.InputStream in)
|
boolean |
remove(java.lang.String name)
This method removes max. |
int |
removeAll(java.lang.String name)
This method removes *all* header lines with the given key (name). |
int |
replaceAll(HTTPHeaderLine element)
This method replaces all existing header lines matching the passed line's key by the passed line itself. |
boolean |
replaceResponseLine(HTTPHeaderLine statusLine)
|
int |
size()
|
java.lang.String |
toString()
|
java.lang.StringBuffer |
toString(java.lang.StringBuffer b)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String NAME_ACCEPT
public static final java.lang.String NAME_ACCEPT_CHARSET
public static final java.lang.String NAME_ACCEPT_ENCODING
public static final java.lang.String NAME_ACCEPT_LANGUAGE
public static final java.lang.String NAME_CONNECTION
public static final java.lang.String NAME_CONTENT_DISPOSITION
public static final java.lang.String NAME_CONTENT_LENGTH
public static final java.lang.String NAME_CONTENT_RANGE
public static final java.lang.String NAME_CONTENT_TYPE
public static final java.lang.String NAME_COOKIE
public static final java.lang.String NAME_HOST
public static final java.lang.String NAME_REFERER
public static final java.lang.String NAME_USER_AGENT
public static final java.lang.String NAME_ALLOW
public static final java.lang.String NAME_WWW_AUTHENTICATE
Constructor Detail |
---|
public HTTPHeaders()
Method Detail |
---|
public java.lang.String getStringValue(java.lang.String key)
public java.lang.Long getLongValue(java.lang.String key)
public boolean isGETRequest()
public boolean isPOSTRequest()
public boolean isOPTIONSRequest()
public boolean isHEADRequest()
public boolean isTRACERequest()
public boolean replaceResponseLine(HTTPHeaderLine statusLine) throws java.lang.NullPointerException, HeaderFormatException
java.lang.NullPointerException
HeaderFormatException
public java.util.Set<HTTPHeaderLine> getAll(java.lang.String name) throws java.lang.NullPointerException
name
- The desired headers' name (the key; must not be null).
java.lang.NullPointerException
- If name is null.public HTTPHeaderLine get(java.lang.String name) throws java.lang.NullPointerException
name
- The desired header line's name (key; must not be null).
java.lang.NullPointerException
- If name is null.public boolean add(java.lang.String key, java.lang.String value) throws java.lang.NullPointerException
key
- The new line's key.value
- Thw new line's value.
java.lang.NullPointerException
- If the key is null.public boolean add(HTTPHeaderLine e) throws java.lang.NullPointerException
key
- The new line's key.
java.lang.NullPointerException
- If the line is null.public boolean add(HTTPHeaderLine e, boolean replaceIfExists)
public boolean remove(java.lang.String name) throws java.lang.NullPointerException
name
- The header line's name (key).
java.lang.NullPointerException
- If the passed name is null.public int removeAll(java.lang.String name) throws java.lang.NullPointerException
name
- The header line's name (key).
java.lang.NullPointerException
- If the passed name is null.public int replaceAll(HTTPHeaderLine element) throws java.lang.NullPointerException
element
- The header line you want to use as replacement (replacing all existing
lines with the same key).
java.lang.NullPointerException
- If the passed element is null.public HTTPHeaderLine get(int index) throws java.lang.IndexOutOfBoundsException
java.lang.IndexOutOfBoundsException
public java.util.Iterator<HTTPHeaderLine> iterator()
public int size()
public java.lang.String getRequestMethod()
public java.lang.String getRequestProtocol()
public java.lang.String getRequestVersion()
public java.lang.String getRequestURI()
public java.lang.String getResponseStatus()
public java.lang.String getResponseReasonPhrase()
public static HTTPHeaders read(java.io.InputStream in) throws java.io.EOFException, java.io.IOException
java.io.EOFException
java.io.IOException
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.StringBuffer toString(java.lang.StringBuffer b)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |