| java.lang.Object org.mortbay.jetty.HttpFields
HttpFields | public class HttpFields (Code) | | HTTP Fields. A collection of HTTP header and or Trailer fields. This class is not synchronized
and needs to be protected from concurrent access.
This class is not synchronized as it is expected that modifications will only be performed by a
single thread.
author: Greg Wilkins (gregw) |
Inner Class :final public static class Field | |
Constructor Summary | |
public | HttpFields() Constructor. |
Method Summary | |
public void | add(String name, String value) Add to or set a field. | public void | add(Buffer name, Buffer value) Add to or set a field. | public void | add(HttpFields fields) Add fields from another HttpFields instance. | public void | addDateField(String name, long date) Sets the value of a date field. | public void | addLongField(String name, long value) Sets the value of an long field. | public void | addLongField(Buffer name, long value) Sets the value of an long field. | public void | addSetCookie(Cookie cookie) | public void | clear() Clear the header. | public boolean | containsKey(Buffer name) | public boolean | containsKey(String name) | public void | destroy() Destroy the header. | public static String | formatDate(long date, boolean cookie) | public static String | formatDate(Calendar calendar, boolean cookie) | public static String | formatDate(StringBuffer buf, long date, boolean cookie) | public static void | formatDate(StringBuffer buf, Calendar calendar, boolean cookie) | public Buffer | get(Buffer name) the value of a field, or null if not found. | public long | getDateField(String name) Get a header as a date value. | public Enumeration | getFieldNames() Get enumeration of header _names. | public Iterator | getFields() Get enumeration of Fields Returns an enumeration of Fields for this request. | public long | getLongField(String name) Get a header as an long value. | public long | getLongField(Buffer name) Get a header as an long value. | public static Float | getQuality(String value) | public String | getStringField(String name) the value of a field, or null if not found. | public String | getStringField(Buffer name) the value of a field, or null if not found. | public Enumeration | getValues(String name) | public Enumeration | getValues(Buffer name) | public Enumeration | getValues(String name, String separators) Get multi field values with separator. | public void | put(String name, String value) Set a field.
Parameters: name - the name of the field Parameters: value - the value of the field. | public void | put(Buffer name, String value) Set a field.
Parameters: name - the name of the field Parameters: value - the value of the field. | public void | put(Buffer name, Buffer value) Set a field.
Parameters: name - the name of the field Parameters: value - the value of the field. | public void | put(String name, List list) Set a field.
Parameters: name - the name of the field Parameters: list - the List value of the field. | public void | put(Buffer buffer) | public void | putDateField(Buffer name, long date) Sets the value of a date field. | public void | putDateField(String name, long date) Sets the value of a date field. | public void | putLongField(Buffer name, long value) Sets the value of an long field. | public void | putLongField(String name, long value) Sets the value of an long field. | public static List | qualityList(Enumeration e) List values in quality order. | public void | remove(String name) Remove a field. | public void | remove(Buffer name) Remove a field. | public String | toString() | public static String | valueParameters(String value, Map parameters) Get field value parameters. | public void | write(Writer writer) |
__01Jan1970_BUFFER | final public static Buffer __01Jan1970_BUFFER(Code) | | |
_revision | protected int _revision(Code) | | |
HttpFields | public HttpFields()(Code) | | Constructor.
|
add | public void add(String name, String value) throws IllegalArgumentException(Code) | | Add to or set a field. If the field is allowed to have multiple values, add will add multiple
headers of the same name.
Parameters: name - the name of the field Parameters: value - the value of the field. exception: IllegalArgumentException - If the name is a single valued field and already has avalue. |
add | public void add(Buffer name, Buffer value) throws IllegalArgumentException(Code) | | Add to or set a field. If the field is allowed to have multiple values, add will add multiple
headers of the same name.
Parameters: name - the name of the field Parameters: value - the value of the field. exception: IllegalArgumentException - If the name is a single valued field and already has avalue. |
add | public void add(HttpFields fields)(Code) | | Add fields from another HttpFields instance. Single valued fields are replaced, while all
others are added.
Parameters: fields - |
addDateField | public void addDateField(String name, long date)(Code) | | Sets the value of a date field.
Parameters: name - the field name Parameters: date - the field date value |
addLongField | public void addLongField(String name, long value)(Code) | | Sets the value of an long field.
Parameters: name - the field name Parameters: value - the field long value |
addLongField | public void addLongField(Buffer name, long value)(Code) | | Sets the value of an long field.
Parameters: name - the field name Parameters: value - the field long value |
addSetCookie | public void addSetCookie(Cookie cookie)(Code) | | Format a set cookie value
Parameters: cookie - The cookie. Parameters: cookie2 - If true, use the alternate cookie 2 header |
clear | public void clear()(Code) | | Clear the header.
|
destroy | public void destroy()(Code) | | Destroy the header. Help the garbage collector by null everything that we can.
|
formatDate | public static String formatDate(long date, boolean cookie)(Code) | | Format HTTP date "EEE, dd MMM yyyy HH:mm:ss 'GMT'" or "EEE, dd-MMM-yy HH:mm:ss 'GMT'"for
cookies
|
formatDate | public static String formatDate(Calendar calendar, boolean cookie)(Code) | | Format HTTP date "EEE, dd MMM yyyy HH:mm:ss 'GMT'" or "EEE, dd-MMM-yy HH:mm:ss 'GMT'"for
cookies
|
formatDate | public static String formatDate(StringBuffer buf, long date, boolean cookie)(Code) | | Format HTTP date "EEE, dd MMM yyyy HH:mm:ss 'GMT'" or "EEE, dd-MMM-yy HH:mm:ss 'GMT'"for
cookies
|
formatDate | public static void formatDate(StringBuffer buf, Calendar calendar, boolean cookie)(Code) | | Format HTTP date "EEE, dd MMM yyyy HH:mm:ss 'GMT'" or "EEE, dd-MMM-yy HH:mm:ss 'GMT'"for
cookies
|
get | public Buffer get(Buffer name)(Code) | | the value of a field, or null if not found. For multiple fields of the same name,only the first is returned. Parameters: name - the case-insensitive field name |
getDateField | public long getDateField(String name)(Code) | | Get a header as a date value. Returns the value of a date field, or -1 if not found. The case
of the field name is ignored.
Parameters: name - the case-insensitive field name |
getFieldNames | public Enumeration getFieldNames()(Code) | | Get enumeration of header _names. Returns an enumeration of strings representing the header
_names for this request.
|
getFields | public Iterator getFields()(Code) | | Get enumeration of Fields Returns an enumeration of Fields for this request.
|
getLongField | public long getLongField(String name) throws NumberFormatException(Code) | | Get a header as an long value. Returns the value of an integer field or -1 if not found. The
case of the field name is ignored.
Parameters: name - the case-insensitive field name exception: NumberFormatException - If bad long found |
getLongField | public long getLongField(Buffer name) throws NumberFormatException(Code) | | Get a header as an long value. Returns the value of an integer field or -1 if not found. The
case of the field name is ignored.
Parameters: name - the case-insensitive field name exception: NumberFormatException - If bad long found |
getStringField | public String getStringField(String name)(Code) | | the value of a field, or null if not found. For multiple fields of the same name,only the first is returned. Parameters: name - the case-insensitive field name |
getStringField | public String getStringField(Buffer name)(Code) | | the value of a field, or null if not found. For multiple fields of the same name,only the first is returned. Parameters: name - the case-insensitive field name |
getValues | public Enumeration getValues(String name)(Code) | | Get multi headers
Enumeration of the values, or null if no such header. Parameters: name - the case-insensitive field name |
getValues | public Enumeration getValues(Buffer name)(Code) | | Get multi headers
Enumeration of the value Strings, or null if no such header. Parameters: name - the case-insensitive field name |
getValues | public Enumeration getValues(String name, String separators)(Code) | | Get multi field values with separator. The multiple values can be represented as separate
headers of the same name, or by a single header using the separator(s), or a combination of
both. Separators may be quoted.
Parameters: name - the case-insensitive field name Parameters: separators - String of separators. Enumeration of the values, or null if no such header. |
put | public void put(String name, String value)(Code) | | Set a field.
Parameters: name - the name of the field Parameters: value - the value of the field. If null the field is cleared. |
put | public void put(Buffer name, String value)(Code) | | Set a field.
Parameters: name - the name of the field Parameters: value - the value of the field. If null the field is cleared. |
put | public void put(Buffer name, Buffer value)(Code) | | Set a field.
Parameters: name - the name of the field Parameters: value - the value of the field. If null the field is cleared. |
put | public void put(String name, List list)(Code) | | Set a field.
Parameters: name - the name of the field Parameters: list - the List value of the field. If null the field is cleared. |
putDateField | public void putDateField(Buffer name, long date)(Code) | | Sets the value of a date field.
Parameters: name - the field name Parameters: date - the field date value |
putDateField | public void putDateField(String name, long date)(Code) | | Sets the value of a date field.
Parameters: name - the field name Parameters: date - the field date value |
putLongField | public void putLongField(Buffer name, long value)(Code) | | Sets the value of an long field.
Parameters: name - the field name Parameters: value - the field long value |
putLongField | public void putLongField(String name, long value)(Code) | | Sets the value of an long field.
Parameters: name - the field name Parameters: value - the field long value |
qualityList | public static List qualityList(Enumeration e)(Code) | | List values in quality order.
enum Enumeration of values with quality parameters values in quality order. |
remove | public void remove(String name)(Code) | | Remove a field.
Parameters: name - |
remove | public void remove(Buffer name)(Code) | | Remove a field.
Parameters: name - |
valueParameters | public static String valueParameters(String value, Map parameters)(Code) | | Get field value parameters. Some field values can have parameters. This method separates the
value from the parameters and optionally populates a map with the paramters. For example:
FieldName : Value ; param1=val1 ; param2=val2
Parameters: value - The Field value, possibly with parameteres. Parameters: parameters - A map to populate with the parameters, or null The value. |
|
|