|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||
java.lang.Object | +--Header
A class to handle a general Header.
| Inner Class Summary | |
protected class |
Header.HeaderEntry
This class holds a header entry, that has the folowing form "type: some text" |
| Field Summary | |
static java.lang.String |
CRLF
The String consisting of \r and \n |
static java.lang.String |
FIELD_SEPARATOR
The Field separator |
protected java.util.Hashtable |
hHeaderEntries
The hashtable of the headers. keys used are types, values are HeaderEntry Objects |
| Constructor Summary | |
Header()
Create a new empty Header |
|
Header(java.io.DataInputStream in)
Create a new Header where entries are read from a given stream |
|
| Method Summary | |
java.lang.String |
getHeaderEntryValue(java.lang.String type)
get the value of header type |
void |
read(java.io.DataInputStream in)
Read in this header from the given Stream. |
void |
read(java.io.DataInputStream in,
java.lang.String firstline)
Read in this header from the given Stream. |
void |
removeHeaderEntry(java.lang.String type)
removes a headerline from this header |
void |
setHeaderEntry(java.lang.String type,
java.lang.String value)
Set or replaces a value for given type. |
java.lang.String |
toString()
Get the text value of this header |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected java.util.Hashtable hHeaderEntries
public static final java.lang.String CRLF
public static final java.lang.String FIELD_SEPARATOR
| Constructor Detail |
public Header()
public Header(java.io.DataInputStream in)
throws java.io.IOException
| Method Detail |
public void read(java.io.DataInputStream in)
throws java.io.IOException
in - the Stream to read the header from.
public void read(java.io.DataInputStream in,
java.lang.String firstline)
throws java.io.IOException
in - the Stream to read the header from.firstline - the first line of this header.public java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String getHeaderEntryValue(java.lang.String type)
type - the HeaderEntry were intrested in.
public void setHeaderEntry(java.lang.String type,
java.lang.String value)
type - the type or category that we want to set.value - the value we want to setpublic void removeHeaderEntry(java.lang.String type)
type - the type we want to remove
|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||