|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.mortbay.http.HttpFields
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.
Nested Class Summary | |
class |
HttpFields.Entry
|
Field Summary | |
static java.lang.String |
__01Jan1970
|
static java.lang.String |
__Accept
Request Fields. |
static java.lang.String |
__AcceptCharset
Request Fields. |
static java.lang.String |
__AcceptEncoding
Request Fields. |
static java.lang.String |
__AcceptLanguage
Request Fields. |
static java.lang.String |
__AcceptRanges
Response Fields. |
static java.lang.String |
__Age
Response Fields. |
static java.lang.String |
__Allow
Entity Fields. |
static java.lang.String |
__Authorization
Request Fields. |
static java.lang.String |
__CacheControl
General Fields. |
static java.lang.String |
__Chunked
Fields Values. |
static java.lang.String |
__Close
|
static char[] |
__COLON
|
static java.lang.String |
__Connection
General Fields. |
static java.lang.String |
__ContentEncoding
Entity Fields. |
static java.lang.String |
__ContentLanguage
Entity Fields. |
static java.lang.String |
__ContentLength
Entity Fields. |
static java.lang.String |
__ContentLocation
Entity Fields. |
static java.lang.String |
__ContentMD5
Entity Fields. |
static java.lang.String |
__ContentRange
Entity Fields. |
static java.lang.String |
__ContentType
Entity Fields. |
static java.lang.String |
__Cookie
Other Fields. |
static char[] |
__CRLF
|
static java.lang.String |
__Date
General Fields. |
static DateCache |
__dateCache
|
static java.lang.ThreadLocal |
__dateReceiveCache
|
static java.text.SimpleDateFormat[] |
__dateReceiveSource
|
static java.lang.String |
__ETag
Response Fields. |
static java.lang.String |
__Expect
Request Fields. |
static java.lang.String |
__ExpectContinue
|
static java.lang.String |
__Expires
Entity Fields. |
static java.lang.String |
__Forwarded
Request Fields. |
static java.lang.String |
__From
Request Fields. |
static java.util.TimeZone |
__GMT
|
static java.lang.String |
__Host
Request Fields. |
static java.lang.String |
__Identity
Other Fields. |
static java.lang.String |
__IfMatch
Request Fields. |
static java.lang.String |
__IfModifiedSince
Request Fields. |
static java.lang.String |
__IfNoneMatch
Request Fields. |
static java.lang.String |
__IfRange
Request Fields. |
static java.lang.String |
__IfUnmodifiedSince
Request Fields. |
static java.lang.String |
__KeepAlive
Request Fields. |
static java.lang.String |
__LastModified
Entity Fields. |
static java.lang.String |
__Location
Response Fields. |
static java.lang.String |
__MaxForwards
Request Fields. |
static java.lang.String |
__MessageHttp
|
static java.lang.String |
__MimeVersion
Other Fields. |
static java.lang.String |
__Pragma
General Fields. |
static java.lang.String |
__ProxyAuthenticate
Response Fields. |
static java.lang.String |
__ProxyAuthorization
Request Fields. |
static java.lang.String |
__ProxyConnection
General Fields. |
static java.lang.String |
__Range
Request Fields. |
static java.lang.String |
__Referer
Request Fields. |
static java.lang.String |
__RequestRange
Request Fields. |
static java.lang.String |
__RetryAfter
Response Fields. |
static java.lang.String |
__separators
|
static java.lang.String |
__Server
Response Fields. |
static java.lang.String |
__ServletEngine
Response Fields. |
static java.lang.String |
__SetCookie
Other Fields. |
static java.lang.String |
__SetCookie2
Other Fields. |
static java.lang.String |
__SoapAction
Other Fields. |
static java.lang.String |
__TE
Request Fields. |
static java.lang.String |
__TextHtml
|
static java.lang.String |
__Trailer
General Fields. |
static java.lang.String |
__TransferEncoding
General Fields. |
static java.lang.String |
__Upgrade
General Fields. |
static java.lang.String |
__UserAgent
Request Fields. |
static java.lang.String |
__Vary
Response Fields. |
static java.lang.String |
__Via
General Fields. |
static java.lang.String |
__Warning
General Fields. |
static java.lang.String |
__WwwAuthenticate
Response Fields. |
static java.lang.String |
__WwwFormUrlEncode
|
static java.lang.String |
__XForwardedFor
Request Fields. |
Constructor Summary | |
HttpFields()
Constructor. |
Method Summary | |
void |
add(HttpFields fields)
Add fields from another HttpFields instance. |
void |
add(java.lang.String name,
java.lang.String value)
Add to or set a field. |
void |
addDateField(java.lang.String name,
java.util.Date date)
Adds the value of a date field. |
void |
addDateField(java.lang.String name,
long date)
Adds the value of a date field. |
void |
addSetCookie(Cookie cookie,
boolean cookie2)
Format a set cookie value |
void |
clear()
Clear the header. |
boolean |
containsKey(java.lang.String name)
|
void |
destroy()
Destroy the header. |
static java.lang.String |
formatDate(java.util.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 java.lang.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 void |
formatDate(java.lang.StringBuffer buf,
java.util.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 java.lang.String |
formatDate(java.lang.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 |
java.lang.String |
get(java.lang.String name)
|
long |
getDateField(java.lang.String name)
Get a header as a date value. |
java.util.Enumeration |
getFieldNames()
Get enumeration of header _names. |
int |
getIntField(java.lang.String name)
Get a header as an integer value. |
static java.lang.Float |
getQuality(java.lang.String value)
|
java.util.Enumeration |
getValues(java.lang.String name)
Get multi headers |
java.util.Enumeration |
getValues(java.lang.String name,
java.lang.String separators)
Get multi field values with separator. |
java.util.Iterator |
iterator()
return an iterator for field name:value pairs |
void |
put(java.lang.String name,
java.util.List list)
Set a field. |
java.lang.String |
put(java.lang.String name,
java.lang.String value)
Set a field. |
void |
putDateField(java.lang.String name,
java.util.Date date)
Sets the value of a date field. |
void |
putDateField(java.lang.String name,
long date)
Sets the value of a date field. |
void |
putIntField(java.lang.String name,
int value)
Sets the value of an integer field. |
static java.util.List |
qualityList(java.util.Enumeration enum)
List values in quality order. |
void |
read(LineInput in)
Read HttpHeaders from inputStream. |
java.lang.String |
remove(java.lang.String name)
Remove a field. |
int |
size()
|
java.lang.String |
toString()
|
static java.lang.String |
valueParameters(java.lang.String value,
java.util.Map parameters)
Get field value parameters. |
void |
write(java.io.Writer writer)
|
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final java.lang.String __CacheControl
public static final java.lang.String __Connection
public static final java.lang.String __Date
public static final java.lang.String __Pragma
public static final java.lang.String __ProxyConnection
public static final java.lang.String __Trailer
public static final java.lang.String __TransferEncoding
public static final java.lang.String __Upgrade
public static final java.lang.String __Via
public static final java.lang.String __Warning
public static final java.lang.String __Allow
public static final java.lang.String __ContentEncoding
public static final java.lang.String __ContentLanguage
public static final java.lang.String __ContentLength
public static final java.lang.String __ContentLocation
public static final java.lang.String __ContentMD5
public static final java.lang.String __ContentRange
public static final java.lang.String __ContentType
public static final java.lang.String __Expires
public static final java.lang.String __LastModified
public static final java.lang.String __Accept
public static final java.lang.String __AcceptCharset
public static final java.lang.String __AcceptEncoding
public static final java.lang.String __AcceptLanguage
public static final java.lang.String __Authorization
public static final java.lang.String __Expect
public static final java.lang.String __Forwarded
public static final java.lang.String __From
public static final java.lang.String __Host
public static final java.lang.String __IfMatch
public static final java.lang.String __IfModifiedSince
public static final java.lang.String __IfNoneMatch
public static final java.lang.String __IfRange
public static final java.lang.String __IfUnmodifiedSince
public static final java.lang.String __KeepAlive
public static final java.lang.String __MaxForwards
public static final java.lang.String __ProxyAuthorization
public static final java.lang.String __Range
public static final java.lang.String __RequestRange
public static final java.lang.String __Referer
public static final java.lang.String __TE
public static final java.lang.String __UserAgent
public static final java.lang.String __XForwardedFor
public static final java.lang.String __AcceptRanges
public static final java.lang.String __Age
public static final java.lang.String __ETag
public static final java.lang.String __Location
public static final java.lang.String __ProxyAuthenticate
public static final java.lang.String __RetryAfter
public static final java.lang.String __Server
public static final java.lang.String __ServletEngine
public static final java.lang.String __Vary
public static final java.lang.String __WwwAuthenticate
public static final java.lang.String __Cookie
public static final java.lang.String __SetCookie
public static final java.lang.String __SetCookie2
public static final java.lang.String __MimeVersion
public static final java.lang.String __Identity
public static final java.lang.String __SoapAction
public static final java.lang.String __Chunked
public static final java.lang.String __Close
public static final java.lang.String __TextHtml
public static final java.lang.String __MessageHttp
public static final java.lang.String __WwwFormUrlEncode
public static final java.lang.String __ExpectContinue
public static final java.lang.String __separators
public static final char[] __CRLF
public static final char[] __COLON
public static java.util.TimeZone __GMT
public static final DateCache __dateCache
public static java.text.SimpleDateFormat[] __dateReceiveSource
public static java.lang.ThreadLocal __dateReceiveCache
public static final java.lang.String __01Jan1970
Constructor Detail |
public HttpFields()
Method Detail |
public static java.lang.String formatDate(long date, boolean cookie)
public static java.lang.String formatDate(java.util.Calendar calendar, boolean cookie)
public static java.lang.String formatDate(java.lang.StringBuffer buf, long date, boolean cookie)
public static void formatDate(java.lang.StringBuffer buf, java.util.Calendar calendar, boolean cookie)
public int size()
public java.util.Enumeration getFieldNames()
public boolean containsKey(java.lang.String name)
public java.lang.String get(java.lang.String name)
name
- the case-insensitive field name
public java.util.Enumeration getValues(java.lang.String name)
name
- the case-insensitive field name
public java.util.Enumeration getValues(java.lang.String name, java.lang.String separators)
name
- the case-insensitive field nameseparators
- String of separators.
public java.lang.String put(java.lang.String name, java.lang.String value)
name
- the name of the fieldvalue
- the value of the field. If null the field is cleared.public void put(java.lang.String name, java.util.List list)
name
- the name of the fieldlist
- the List value of the field. If null the field is cleared.public void add(java.lang.String name, java.lang.String value) throws java.lang.IllegalArgumentException
name
- the name of the fieldvalue
- the value of the field.
java.lang.IllegalArgumentException
- If the name is a single
valued field and already has a value.public java.lang.String remove(java.lang.String name)
name
- public int getIntField(java.lang.String name) throws java.lang.NumberFormatException
name
- the case-insensitive field name
java.lang.NumberFormatException
- If bad integer foundpublic long getDateField(java.lang.String name)
name
- the case-insensitive field namepublic void putIntField(java.lang.String name, int value)
name
- the field namevalue
- the field integer valuepublic void putDateField(java.lang.String name, java.util.Date date)
name
- the field namedate
- the field date valuepublic void addDateField(java.lang.String name, java.util.Date date)
name
- the field namedate
- the field date valuepublic void addDateField(java.lang.String name, long date)
name
- the field namedate
- the field date valuepublic void putDateField(java.lang.String name, long date)
name
- the field namedate
- the field date valuepublic void read(LineInput in) throws java.io.IOException
java.io.IOException
public void write(java.io.Writer writer) throws java.io.IOException
java.io.IOException
public java.lang.String toString()
toString
in class java.lang.Object
public void clear()
public void destroy()
public static java.lang.String valueParameters(java.lang.String value, java.util.Map parameters)
FieldName : Value ; param1=val1 ; param2=val2
value
- The Field value, possibly with parameteres.parameters
- A map to populate with the parameters, or null
public static java.lang.Float getQuality(java.lang.String value)
public static java.util.List qualityList(java.util.Enumeration enum)
enum
- Enumeration of values with quality parameters
public void addSetCookie(Cookie cookie, boolean cookie2)
cookie
- The cookie.cookie2
- If true, use the alternate cookie 2 headerpublic void add(HttpFields fields)
fields
- public java.util.Iterator iterator()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |