|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectrabbit.http.GeneralHeader
public class GeneralHeader
A class to handle general headers.
| Field Summary | |
|---|---|
protected java.util.ArrayList<Header> |
headers
The headers of this Header in order. |
| Constructor Summary | |
|---|---|
GeneralHeader()
Create a new HTTPHeader from scratch |
|
| Method Summary | |
|---|---|
void |
addHeader(Header h)
Add a new header. |
void |
addHeader(java.lang.String type,
java.lang.String value)
Add a new header. |
void |
copyHeader(GeneralHeader to)
Copy all headers in this header to the given header. |
protected void |
fillBuffer(java.lang.StringBuilder sb)
Fill the given StringBuilder with text from this header. |
java.lang.String |
getHeader(java.lang.String type)
get the value of header type |
java.util.List<java.lang.String> |
getHeaders(java.lang.String type)
Get all headers of a specified type... |
void |
read(java.io.DataInput in)
Fill in this object with data from the given input. |
void |
removeHeader(java.lang.String type)
removes a headerline from this header |
void |
removeValue(java.lang.String value)
removes a header with the specified value |
void |
setExistingValue(java.lang.String current,
java.lang.String newValue)
Set a specified header |
void |
setHeader(java.lang.String type,
java.lang.String value)
Set or replaces a value for given type. |
int |
size()
Get the number of headers set in this header. |
java.lang.String |
toString()
Get the text value of this header |
void |
write(java.io.DataOutput out)
Write this object to the given output. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected final java.util.ArrayList<Header> headers
| Constructor Detail |
|---|
public GeneralHeader()
| Method Detail |
|---|
public int size()
public java.lang.String toString()
toString in class java.lang.Objectprotected void fillBuffer(java.lang.StringBuilder sb)
sb - the StringBuilder this header is written topublic java.lang.String getHeader(java.lang.String type)
type - the Header were intrested in.
public void setHeader(java.lang.String type,
java.lang.String value)
type - the type or category that we want to set.value - the value we want to set
public void setExistingValue(java.lang.String current,
java.lang.String newValue)
current - the type or category that we want to set.newValue - the value we want to set
public void addHeader(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 addHeader(Header h)
h - the Header to addpublic void removeHeader(java.lang.String type)
type - the type we want to removepublic void removeValue(java.lang.String value)
value - the value of the header we want to removepublic java.util.List<java.lang.String> getHeaders(java.lang.String type)
type - the type of the headers to get, eg. "Cache-Control".
public void copyHeader(GeneralHeader to)
to - the GeneralHeader to add headers to.
public void read(java.io.DataInput in)
throws java.io.IOException
Storable
read in interface Storablein - the input to read from
java.io.IOException - if reading fails
public void write(java.io.DataOutput out)
throws java.io.IOException
Storable
write in interface Storableout - the output to write to
java.io.IOException - if writing fails
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||