public class HttpFields extends Object
Modifier and Type | Class and Description |
---|---|
class |
HttpFields.Entry |
Modifier and Type | Field and Description |
---|---|
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 char[] |
__COLON |
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[] |
__CRLF |
static String |
__Date
General Fields.
|
static DateCache |
__dateCache |
static ThreadLocal |
__dateReceiveCache |
static SimpleDateFormat[] |
__dateReceiveSource |
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 |
__TE
Request Fields.
|
static String |
__TextHtml |
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 and Description |
---|
HttpFields()
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
add(HttpFields fields)
Add fields from another HttpFields instance.
|
void |
add(String name,
String value)
Add to or set a field.
|
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(javax.servlet.http.Cookie cookie)
Format a set cookie value
|
void |
clear()
Clear the header.
|
boolean |
containsKey(String name) |
void |
destroy()
Destroy the header.
|
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(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
|
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
|
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
|
void |
put(String name,
List list)
Set a field.
|
String |
put(String name,
String value)
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) |
public static final String __CacheControl
public static final String __Connection
public static final String __Date
public static final String __Pragma
public static final String __ProxyConnection
public static final String __Trailer
public static final String __TransferEncoding
public static final String __Upgrade
public static final String __Via
public static final String __Warning
public static final String __Allow
public static final String __ContentEncoding
public static final String __ContentLanguage
public static final String __ContentLength
public static final String __ContentLocation
public static final String __ContentMD5
public static final String __ContentRange
public static final String __ContentType
public static final String __Expires
public static final String __LastModified
public static final String __Accept
public static final String __AcceptCharset
public static final String __AcceptEncoding
public static final String __AcceptLanguage
public static final String __Authorization
public static final String __Expect
public static final String __Forwarded
public static final String __From
public static final String __Host
public static final String __IfMatch
public static final String __IfModifiedSince
public static final String __IfNoneMatch
public static final String __IfRange
public static final String __IfUnmodifiedSince
public static final String __KeepAlive
public static final String __MaxForwards
public static final String __ProxyAuthorization
public static final String __Range
public static final String __RequestRange
public static final String __Referer
public static final String __TE
public static final String __UserAgent
public static final String __XForwardedFor
public static final String __AcceptRanges
public static final String __Age
public static final String __ETag
public static final String __Location
public static final String __ProxyAuthenticate
public static final String __RetryAfter
public static final String __Server
public static final String __ServletEngine
public static final String __Vary
public static final String __WwwAuthenticate
public static final String __Cookie
public static final String __SetCookie
public static final String __SetCookie2
public static final String __MimeVersion
public static final String __Identity
public static final String __SoapAction
public static final String __Chunked
public static final String __Close
public static final String __TextHtml
public static final String __MessageHttp
public static final String __WwwFormUrlEncode
public static final String __ExpectContinue
public static final String __separators
public static final char[] __CRLF
public static final char[] __COLON
public static final DateCache __dateCache
public static SimpleDateFormat[] __dateReceiveSource
public static final ThreadLocal __dateReceiveCache
public static final String __01Jan1970
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 int size()
public Enumeration getFieldNames()
public boolean containsKey(String name)
public String get(String name)
name
- the case-insensitive field namepublic Enumeration getValues(String name)
name
- the case-insensitive field namepublic Enumeration getValues(String name, String separators)
name
- the case-insensitive field nameseparators
- String of separators.public String put(String name, String value)
name
- the name of the fieldvalue
- the value of the field. If null the field is cleared.public void put(String name, List list)
name
- the name of the fieldlist
- the List value of the field. If null the field is cleared.public void add(String name, String value) throws IllegalArgumentException
name
- the name of the fieldvalue
- the value of the field.IllegalArgumentException
- If the name is a single
valued field and already has a value.public int getIntField(String name) throws NumberFormatException
name
- the case-insensitive field nameNumberFormatException
- If bad integer foundpublic long getDateField(String name)
name
- the case-insensitive field namepublic void putIntField(String name, int value)
name
- the field namevalue
- the field integer valuepublic void putDateField(String name, Date date)
name
- the field namedate
- the field date valuepublic void addDateField(String name, Date date)
name
- the field namedate
- the field date valuepublic void addDateField(String name, long date)
name
- the field namedate
- the field date valuepublic void putDateField(String name, long date)
name
- the field namedate
- the field date valuepublic void read(LineInput in) throws IOException
IOException
public void write(Writer writer) throws IOException
IOException
public void clear()
public void destroy()
public static String valueParameters(String value, Map parameters)
FieldName : Value ; param1=val1 ; param2=val2
value
- The Field value, possibly with parameteres.parameters
- A map to populate with the parameters, or nullpublic static List qualityList(Enumeration enm)
enm
- Enumeration of values with quality parameterspublic void addSetCookie(javax.servlet.http.Cookie cookie)
cookie
- The cookie.public void add(HttpFields fields)
fields
- public Iterator iterator()
Copyright © 2013. All rights reserved.