|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--com.ibm.wbi.protocol.http.HttpHeaderAscii
HttpHeaderAscii is an abstract class representing a
complete HTTP header. Use HttpRequestHeader or
HttpResponseHeader to instantiante a header.
HttpRequestHeader,
HttpResponseHeader| Field Summary | |
protected java.lang.String |
httpVersion
|
protected MimeHeaderAscii |
mime
|
protected boolean |
stamp
|
| Constructor Summary | |
HttpHeaderAscii()
Construct a new, empty HttpHeaderAscii. |
|
HttpHeaderAscii(byte[] h)
Construct a new HttpHeaderAscii from the specified
bytes representing ASCII characters. |
|
HttpHeaderAscii(byte[] h,
int offset,
int length)
Construct a new HttpHeaderAscii from the specified
bytes representing ASCII characters. |
|
HttpHeaderAscii(HttpHeaderAscii old)
Construct a new HttpHeaderAscii that is a copy of
an old one. |
|
HttpHeaderAscii(MimeHeaderAscii m)
Construct a new HttpHeaderAscii with the specified
MIME headers. |
|
HttpHeaderAscii(java.lang.String s)
Construct a new HttpHeaderAscii from the specified
String. |
|
| Method Summary | |
void |
add(java.lang.String key,
HeaderField value)
Set the value for a header field, adding to any previous values. |
void |
add(java.lang.String key,
java.lang.String value)
Set the value for a header field, adding to any previous values. |
MimeHeaderAscii |
copyMimeHeader()
Return a clone of the MIME header fields in this header. |
java.lang.String |
get(java.lang.String key)
Get the value of the specified MIME header field. |
java.util.Vector |
getAll(java.lang.String key)
Get all values for a header field. |
java.lang.String |
getMimeHeaderString()
Get the MIME headers only (not the first HTTP line of the header) as a String. |
java.lang.Object |
getRaw(java.lang.String key)
Get the value for a header field. |
java.lang.String |
getVersion()
Get the HTTP protocol version string, e.g., "HTTP/1.0". |
java.util.Enumeration |
keys()
Return a list of all the header keys in this header. |
java.util.Vector |
parseAllHeaderFields(java.lang.String key)
Like parseHeader(String), but returns a
Vector of HeaderFields, one per
instance of the named header field, even if the header field
occurs zero or one times. |
java.util.Vector |
parseAllSplitHeaderFields(java.lang.String key)
Calls parseAllSplitHeaderFields(String key, char delim)
using the delimiter ",". |
java.util.Vector |
parseAllSplitHeaderFields(java.lang.String key,
char delim)
Like parseAllHeaderFields(String key)
|
protected abstract void |
parseFirstLine(java.lang.String line)
|
protected void |
parseHeader(java.lang.String h)
|
HeaderField |
parseHeaderField(java.lang.String key)
Return the first value of the header field named by key as a parsed HeaderField object. |
boolean |
remove(java.lang.String key)
Remove all value(s) for a header field. |
void |
set(java.lang.String key,
HeaderField value)
Set the value for a header field, replacing any previous value(s). |
void |
set(java.lang.String key,
java.lang.String value)
Set the value for a header field, replacing any previous value(s). |
void |
setVersion(java.lang.String v)
Set the HTTP protocol version string. |
void |
stamp()
|
boolean |
stamped()
|
abstract java.lang.String |
toString()
Returns a String representation of the header. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected java.lang.String httpVersion
protected MimeHeaderAscii mime
protected boolean stamp
| Constructor Detail |
public HttpHeaderAscii()
HttpHeaderAscii.public HttpHeaderAscii(MimeHeaderAscii m)
HttpHeaderAscii with the specified
MIME headers.m - The MIME headers.
public HttpHeaderAscii(byte[] h)
throws MalformedHeaderException
HttpHeaderAscii from the specified
bytes representing ASCII characters.h - The header bytes.
public HttpHeaderAscii(byte[] h,
int offset,
int length)
throws MalformedHeaderException
HttpHeaderAscii from the specified
bytes representing ASCII characters.h - The array containing the header bytes.offset - The offset within the array where the header starts.length - The number of bytes within the array comprising
the header.
public HttpHeaderAscii(java.lang.String s)
throws MalformedHeaderException
HttpHeaderAscii from the specified
String.s - The String containing the header text.public HttpHeaderAscii(HttpHeaderAscii old)
HttpHeaderAscii that is a copy of
an old one.old - The header to copy.| Method Detail |
public java.lang.String getVersion()
public void setVersion(java.lang.String v)
v - The version string.public java.lang.String getMimeHeaderString()
public abstract java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String get(java.lang.String key)
key - The name of the header field.null if not set.public java.util.Vector getAll(java.lang.String key)
key - The case-insensitive name of the header fieldVector containing all
String values to which the key is mapped, even
if zero or one.public java.lang.Object getRaw(java.lang.String key)
key - The case-insensitive name of the header fieldnull if key is unmapped, or a
HeaderField representing the single value to which
key is mapped, or the Vector
containing the one or more values to which key is
mapped.public HeaderField parseHeaderField(java.lang.String key)
key as a parsed HeaderField object.
If that HeaderField object is modified, then
set() must be used to update the header itself:
the HeaderField object is a copy, not a reference.key - The name of the header field.HeaderField.set(String, HeaderField),
HeaderFieldpublic java.util.Vector parseAllHeaderFields(java.lang.String key)
parseHeader(String), but returns a
Vector of HeaderFields, one per
instance of the named header field, even if the header field
occurs zero or one times.key - The name of the header field.Vector of parsed HeaderFieldsparseHeaderField(String)public java.util.Vector parseAllSplitHeaderFields(java.lang.String key)
parseAllSplitHeaderFields(String key, char delim)
using the delimiter ",".key - the name of the header field.Vector of HeaderField
objects.parseHeaderField(String),
parseAllSplitHeaderFields(String, char)
public java.util.Vector parseAllSplitHeaderFields(java.lang.String key,
char delim)
parseAllHeaderFields(String key)Accept: a/b, c/d would produce a vector of
two HeaderField objects, one representing a/b, the
other representing c/d.key - The name of the header field.Vector of HeaderField
objects.parseHeaderField(String),
parseAllHeaderFields(String key)
public void set(java.lang.String key,
java.lang.String value)
key - The case-insensitive name of the header field.value - The new value for the field.
public void set(java.lang.String key,
HeaderField value)
key - The case-insensitive name of the header field.value - The new value for the field.
public void add(java.lang.String key,
java.lang.String value)
key - The case-insensitive name of the header field.value - The new value to add.
public void add(java.lang.String key,
HeaderField value)
key - The case-insensitive name of the header field.value - The new value to add.public boolean remove(java.lang.String key)
key - The case-insensitive name of the header fieldtrue if all values were removed,
false if key already had no value.public java.util.Enumeration keys()
Enumerationpublic void stamp()
public boolean stamped()
public MimeHeaderAscii copyMimeHeader()
protected void parseHeader(java.lang.String h)
throws MalformedHeaderException
protected abstract void parseFirstLine(java.lang.String line)
throws MalformedHeaderException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||