| java.lang.Object org.apache.harmony.luni.internal.net.www.protocol.http.Header
Header | public class Header implements Cloneable(Code) | | The general structure for request / response header. It is essentially
constructed by hashtable with key indexed in a vector for position lookup.
|
Constructor Summary | |
public | Header() A generic header structure. | public | Header(Map<String, List<String>> map) The alternative constructor which sets the input map as its initial
keyTable. |
Header | public Header()(Code) | | A generic header structure. Used mostly for request / response header.
The key/value pair of the header may be inserted for later use. The key
is stored in an array for indexed slot access.
|
Header | public Header(Map<String, List<String>> map)(Code) | | The alternative constructor which sets the input map as its initial
keyTable.
Parameters: map - the initial keyTable as a map |
add | public void add(String key, String value)(Code) | | Add a field with the specified value.
Parameters: key - Parameters: value - |
get | public String get(int pos)(Code) | | Answers the element at pos , null if no such element
exist.
java.lang.String the value of the key Parameters: pos - int the position to look for |
get | public String get(String key)(Code) | | Answers the value corresponding to the specified key.
Parameters: key - the key to look up. Answers the value for the given key, or null if nosuch key exists. |
getFieldMap | public Map<String, List<String>> getFieldMap()(Code) | | Provides an unmodifiable map with all String header names mapped to their
String values. The map keys are Strings and the values are unmodifiable
Lists of Strings.
an unmodifiable map of the headers since: 1.4 |
getKey | public String getKey(int pos)(Code) | | Answers the key of this header at pos , null if there are
fewer keys in the header
the key the desired position Parameters: pos - the position to look for |
getStatusLine | public String getStatusLine()(Code) | | Gets the status line in the header request example: GET / HTTP/1.1
response example: HTTP/1.1 200 OK
the status line |
length | public int length()(Code) | | Answers the number of keys stored in this header
the number of keys. |
set | public void set(String key, String value)(Code) | | Set a field with the specified value. If the field is not found, it is
added. If the field is found, the existing value(s) are overwritten.
Parameters: key - Parameters: value - |
setStatusLine | public void setStatusLine(String statusLine)(Code) | | Sets the status line in the header request example: GET / HTTP/1.1
response example: HTTP/1.1 200 OK
Parameters: statusLine - |
|
|