public class HeaderSet extends java.lang.Object implements Headers, com.vordel.common.Dictionary
Note that in HTTP, not all headers are Body headers. "Connection-" headers, for example should not be included in a HeaderSet associated with a Body.
The "Content-Length" header is also a special case: because its value changes with the state of the body, it is unsafe to include here.
Modifier and Type | Class and Description |
---|---|
static class |
HeaderSet.Header
Represents a single header in a header set.
|
static class |
HeaderSet.HeaderEntry |
Constructor and Description |
---|
HeaderSet() |
HeaderSet(HeaderSet headers) |
Modifier and Type | Method and Description |
---|---|
void |
addHeader(java.lang.String name,
java.lang.Object o)
Adds a header with the given value.
|
void |
addHeader(java.lang.String name,
java.lang.String o)
Adds a header with the given value.
|
boolean |
containsKey(java.lang.String key) |
java.util.Set<java.util.Map.Entry<java.lang.String,HeaderSet.HeaderEntry>> |
entrySet() |
java.lang.Object |
get(java.lang.String key) |
java.lang.String |
getHeader(java.lang.String name)
Returns the value of the specified request header as a String
Returns a String containing the value of the requested header, or null
if the request does not have a header of that name
|
HeaderSet.HeaderEntry |
getHeaderEntry(java.lang.String name) |
java.util.Iterator<java.lang.String> |
getHeaderNames()
Returns an enumeration of all the header names this request contains.
|
java.util.Iterator<java.lang.String> |
getHeaders(java.lang.String name)
Returns all the values of the specified request header as an
Enumeration of String objects.
|
int |
getHeadersLength() |
int |
getHeadersSize(java.lang.String name) |
java.util.Iterator<java.lang.String> |
getNames() |
java.lang.Object |
getParsed(HeaderParser p) |
java.lang.Object |
getParsed(HeaderParser p,
java.lang.String headerName) |
boolean |
hasHeader(java.lang.String s) |
void |
parseMIME(java.io.InputStream is) |
void |
remove(java.lang.String s) |
void |
setHeader(java.lang.String name,
java.lang.Object o)
Set a header with the given value.
|
void |
setHeader(java.lang.String name,
java.lang.String o)
Set a header with the given value.
|
void |
setHeaderEntry(java.lang.String name,
HeaderSet.HeaderEntry values) |
java.lang.String |
toString() |
void |
write(java.io.OutputStream os,
int flags) |
void |
write(java.io.OutputStream os,
int flags,
java.lang.String encoding) |
public HeaderSet()
public HeaderSet(HeaderSet headers)
public java.lang.String toString()
toString
in class java.lang.Object
public void setHeader(java.lang.String name, java.lang.Object o)
name
- the header nameo
- the parsed form of the header valuepublic void setHeaderEntry(java.lang.String name, HeaderSet.HeaderEntry values)
public void addHeader(java.lang.String name, java.lang.Object o)
name
- the header nameo
- the parsed form of the header valuepublic void setHeader(java.lang.String name, java.lang.String o)
public void addHeader(java.lang.String name, java.lang.String o)
public java.util.Set<java.util.Map.Entry<java.lang.String,HeaderSet.HeaderEntry>> entrySet()
public java.lang.Object getParsed(HeaderParser p, java.lang.String headerName)
public java.lang.Object getParsed(HeaderParser p)
public java.util.Iterator<java.lang.String> getHeaders(java.lang.String name)
getHeaders
in interface Headers
public int getHeadersSize(java.lang.String name)
getHeadersSize
in interface Headers
public int getHeadersLength()
public java.util.Iterator<java.lang.String> getHeaderNames()
getHeaderNames
in interface Headers
public java.lang.String getHeader(java.lang.String name)
public HeaderSet.HeaderEntry getHeaderEntry(java.lang.String name)
public java.util.Iterator<java.lang.String> getNames()
public void write(java.io.OutputStream os, int flags) throws java.io.IOException
java.io.IOException
public void write(java.io.OutputStream os, int flags, java.lang.String encoding) throws java.io.IOException
java.io.IOException
public void remove(java.lang.String s)
public boolean hasHeader(java.lang.String s)
public java.lang.Object get(java.lang.String key)
get
in interface com.vordel.common.Dictionary
public boolean containsKey(java.lang.String key)
public void parseMIME(java.io.InputStream is) throws java.io.IOException
java.io.IOException
This documentation and all its contents and graphics, copyright © 1999 - 2011 Vordel