org.mortbay.http
public class HttpFields extends Object
Version: $Id: HttpFields.java,v 1.77 2006/11/22 20:02:15 gregwilkins Exp $
Nested Class Summary | |
---|---|
class | HttpFields.Entry |
Field Summary | |
---|---|
static String | __01Jan1970 |
static String | __Accept Request Fields. |
static String | __AcceptCharset Request Fields. |
static String | __AcceptEncoding Request Fields. |
static String | __AcceptLanguage Request Fields. |
static String | __AcceptRanges Response Fields. |
static String | __Age Response Fields. |
static String | __Allow Entity Fields. |
static String | __Authorization Request Fields. |
static String | __CacheControl General Fields. |
static String | __Chunked Fields Values. |
static String | __Close |
static String | __Connection General Fields. |
static String | __ContentEncoding Entity Fields. |
static String | __ContentLanguage Entity Fields. |
static String | __ContentLength Entity Fields. |
static String | __ContentLocation Entity Fields. |
static String | __ContentMD5 Entity Fields. |
static String | __ContentRange Entity Fields. |
static String | __ContentType Entity Fields. |
static String | __Cookie Other Fields. |
static char[] | __COLON |
static char[] | __CRLF |
static DateCache | __dateCache |
static ThreadLocal | __dateReceiveCache |
static SimpleDateFormat[] | __dateReceiveSource |
static String | __Date General Fields. |
static String | __ETag Response Fields. |
static String | __Expect Request Fields. |
static String | __ExpectContinue |
static String | __Expires Entity Fields. |
static String | __Forwarded Request Fields. |
static String | __From Request Fields. |
static String | __Host Request Fields. |
static String | __Identity Other Fields. |
static String | __IfMatch Request Fields. |
static String | __IfModifiedSince Request Fields. |
static String | __IfNoneMatch Request Fields. |
static String | __IfRange Request Fields. |
static String | __IfUnmodifiedSince Request Fields. |
static String | __KeepAlive Request Fields. |
static String | __LastModified Entity Fields. |
static String | __Location Response Fields. |
static String | __MaxForwards Request Fields. |
static String | __MessageHttp |
static String | __MimeVersion Other Fields. |
static String | __Pragma General Fields. |
static String | __ProxyAuthenticate Response Fields. |
static String | __ProxyAuthorization Request Fields. |
static String | __ProxyConnection General Fields. |
static String | __Range Request Fields. |
static String | __Referer Request Fields. |
static String | __RequestRange Request Fields. |
static String | __RetryAfter Response Fields. |
static String | __separators |
static String | __Server Response Fields. |
static String | __ServletEngine Response Fields. |
static String | __SetCookie Other Fields. |
static String | __SetCookie2 Other Fields. |
static String | __SoapAction Other Fields. |
static String | __TextHtml |
static String | __TE Request Fields. |
static String | __Trailer General Fields. |
static String | __TransferEncoding General Fields. |
static String | __Upgrade General Fields. |
static String | __UserAgent Request Fields. |
static String | __Vary Response Fields. |
static String | __Via General Fields. |
static String | __Warning General Fields. |
static String | __WwwAuthenticate Response Fields. |
static String | __WwwFormUrlEncode |
static String | __XForwardedFor Request Fields. |
Constructor Summary | |
---|---|
HttpFields() Constructor. |
Method Summary | |
---|---|
void | add(String name, String value) Add to or set a field.
|
void | add(HttpFields fields) Add fields from another HttpFields instance.
|
void | addDateField(String name, Date date)
Adds the value of a date field. |
void | addDateField(String name, long date)
Adds the value of a date field. |
void | addSetCookie(Cookie cookie) Format a set cookie value |
void | clear() Clear the header. |
boolean | containsKey(String name) |
void | destroy() Destroy the header.
|
static String | formatDate(long date, boolean cookie) Format HTTP date
"EEE, dd MMM yyyy HH:mm:ss 'GMT'" or
"EEE, dd-MMM-yy HH:mm:ss 'GMT'"for cookies |
static String | formatDate(Calendar calendar, boolean cookie) Format HTTP date
"EEE, dd MMM yyyy HH:mm:ss 'GMT'" or
"EEE, dd-MMM-yy HH:mm:ss 'GMT'"for cookies |
static String | formatDate(StringBuffer buf, long date, boolean cookie) Format HTTP date
"EEE, dd MMM yyyy HH:mm:ss 'GMT'" or
"EEE, dd-MMM-yy HH:mm:ss 'GMT'"for cookies |
static void | formatDate(StringBuffer buf, Calendar calendar, boolean cookie) Format HTTP date
"EEE, dd MMM yyyy HH:mm:ss 'GMT'" or
"EEE, dd-MMM-yy HH:mm:ss 'GMT'"for cookies |
String | get(String name) |
long | getDateField(String name) Get a header as a date value.
|
Enumeration | getFieldNames() Get enumeration of header _names.
|
int | getIntField(String name) Get a header as an integer value.
|
static Float | getQuality(String value) |
Enumeration | getValues(String name) Get multi headers |
Enumeration | getValues(String name, String separators) Get multi field values with separator.
|
Iterator | iterator()
return an iterator for field name:value pairs |
String | put(String name, String value) Set a field. |
void | put(String name, List list) Set a field. |
void | putDateField(String name, Date date)
Sets the value of a date field. |
void | putDateField(String name, long date)
Sets the value of a date field. |
void | putIntField(String name, int value)
Sets the value of an integer field. |
static List | qualityList(Enumeration enm) List values in quality order. |
void | read(LineInput in) Read HttpHeaders from inputStream. |
String | remove(String name) Remove a field. |
int | size() |
String | toString() |
static String | valueParameters(String value, Map parameters) Get field value parameters.
|
void | write(Writer writer) |
Parameters: name the name of the field value the value of the field.
Throws: IllegalArgumentException If the name is a single valued field and already has a value.
Parameters: fields
Parameters: name the field name date the field date value
Parameters: name the field name date the field date value
Parameters: cookie The cookie.
Parameters: name the case-insensitive field name
Returns: 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
Parameters: name the case-insensitive field name
Throws: NumberFormatException If bad integer found
Parameters: name the case-insensitive field name
Returns: Enumeration of the values, or null if no such header.
Parameters: name the case-insensitive field name separators String of separators.
Returns: Enumeration of the values, or null if no such header.
Returns: an HttpFields.Iterator
Parameters: name the name of the field value the value of the field. If null the field is cleared.
Parameters: name the name of the field list the List value of the field. If null the field is cleared.
Parameters: name the field name date the field date value
Parameters: name the field name date the field date value
Parameters: name the field name value the field integer value
Parameters: enm Enumeration of values with quality parameters
Returns: values in quality order.
Parameters: name
FieldName : Value ; param1=val1 ; param2=val2
Parameters: value The Field value, possibly with parameteres. parameters A map to populate with the parameters, or null
Returns: The value.