|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.w3c.www.http.HttpFactory
public class HttpFactory
Use this class to create pre-defined header values of various kind.
Constructor Summary | |
---|---|
HttpFactory()
|
Method Summary | |
---|---|
static HttpAccept |
makeAccept(MimeType type)
Create an Accept header clause. |
static HttpAccept |
makeAccept(MimeType type,
double quality)
Create an Accept header clause. |
static HttpAcceptCharset |
makeAcceptCharset(java.lang.String charset)
Build an Accept-Charset header clause. |
static HttpAcceptCharset |
makeAcceptCharset(java.lang.String charset,
double quality)
Build an Accept-Charset header clause. |
static HttpAcceptCharsetList |
makeAcceptCharsetList(HttpAcceptCharset[] charsets)
Build a list of accepted charset for the Accept-Charset
header. |
static HttpAcceptEncoding |
makeAcceptEncoding(java.lang.String enc)
Build an Accept-Encoding header clause. |
static HttpAcceptEncoding |
makeAcceptEncoding(java.lang.String enc,
double quality)
Build an Accept-Encoding header clause. |
static HttpAcceptEncodingList |
makeAcceptEncodingList(HttpAcceptEncoding[] encs)
Build a list of accept encoding clauses for the Accept-Encoding
header. |
static HttpAcceptLanguage |
makeAcceptLanguage(java.lang.String lang)
Build an Accept-Language header clause. |
static HttpAcceptLanguage |
makeAcceptLanguage(java.lang.String lang,
double quality)
Build an Accept-Language header clause. |
static HttpAcceptLanguageList |
makeAcceptLanguageList(HttpAcceptLanguage[] langs)
Build a list of accept language clauses for the Accept-Language
header. |
static HttpAcceptList |
makeAcceptList(HttpAccept[] accepts)
Build a list of accept clause, ready for the Accept header. |
static HttpBag |
makeBag(java.lang.String name)
Build a empty bag instance. |
static HttpCacheControl |
makeCacheControl()
Build an empty cache control directive. |
static HttpChallenge |
makeChallenge(java.lang.String scheme)
Build a challenge requesting authorization from a client. |
static HttpContentRange |
makeContentRange(java.lang.String unit,
int firstpos,
int lastpos,
int length)
Build the description of a HTTP content range. |
static HttpCookie |
makeCookie(java.lang.String name,
java.lang.String value)
Build a single cookie value. |
static HttpCookieList |
makeCookieList(HttpCookie[] cookies)
Build a list of cookies out of a set of cookies. |
static HttpCredential |
makeCredential(java.lang.String scheme)
Build credential informations. |
static HttpDate |
makeDate()
Build an HTTP date object representing the current time. |
static HttpDate |
makeDate(long date)
Build an HTTP date object. |
static HttpEntityTag |
makeETag(boolean isWeak,
java.lang.String tag)
Build an entity tag object. |
static HttpEntityTagList |
makeETagList(HttpEntityTag[] tags)
Build an entity tag list. |
static HttpInteger |
makeInteger(int i)
Build a wrapper for an HTTP integer. |
static HttpMimeType |
makeMimeType(MimeType type)
Build a wrapper for a MIME type suitable for HTTP transportation. |
static HttpRange |
makeRange(java.lang.String unit,
int firstpos,
int lastpos)
Build an object representing an HTTP range. |
static HttpRangeList |
makeRangeList(HttpRange[] ranges)
Build a list of ranges. |
static HttpSetCookie |
makeSetCookie(java.lang.String name,
java.lang.String value)
Build a set cookie clause for the Set-Cookie header. |
static HttpSetCookieList |
makeSetCookieList(HttpSetCookie[] setcookies)
Build a list of set cookies commands. |
static HttpString |
makeString(java.lang.String str)
Build a wrapper for a String, for HTTP transportation. |
static HttpTokenList |
makeStringList(java.lang.String item)
Build a list of one string. |
static HttpTokenList |
makeStringList(java.lang.String[] list)
Build a list of strings. |
static HttpWarning |
makeWarning(int status)
Build an HTTP Warning object. |
static HttpWarning |
makeWarning(int status,
java.lang.String agent,
java.lang.String text)
Build an HTTP Warning object. |
static HttpWarningList |
makeWarningList(HttpWarning[] warnings)
Build a list of warnings for the Warning header. |
static HttpAccept |
parseAccept(java.lang.String strval)
Build an accept object by parsing the given string. |
static HttpAcceptCharset |
parseAcceptCharset(java.lang.String strval)
Build an accept charset object by parsing the given string. |
static HttpAcceptCharsetList |
parseAcceptCharsetList(java.lang.String strval)
Build an accept charset list object by parsing the given string. |
static HttpAcceptEncoding |
parseAcceptEncoding(java.lang.String strval)
Build an accept encoding object by parsing the given string. |
static HttpAcceptEncodingList |
parseAcceptEncodingList(java.lang.String strval)
Build an accept encoding list object by parsing the given string. |
static HttpAcceptLanguage |
parseAcceptLanguage(java.lang.String strval)
Build an accept language object by parsing the given string. |
static HttpAcceptLanguageList |
parseAcceptLanguageList(java.lang.String strval)
Build an accept language list object by parsing the given string. |
static HttpAcceptList |
parseAcceptList(java.lang.String strval)
Build an accept list object by parsing the given string. |
static HttpBag |
parseBag(java.lang.String strval)
Build a bag object by parsing the given string. |
static HttpCacheControl |
parseCacheControl(java.lang.String strval)
Build a cache control object by parsing the given string. |
static HttpChallenge |
parseChallenge(java.lang.String strval)
Build a challenge object by parsing the given string. |
static HttpContentRange |
parseContentRange(java.lang.String strval)
Build a content range object by parsing the given string. |
static HttpCookieList |
parseCookieList(java.lang.String strval)
Build a cookie list object by parsing the given string. |
static HttpCredential |
parseCredential(java.lang.String strval)
Build a credential object by parsing the given string. |
static HttpDate |
parseDate(java.lang.String strval)
Build a date object by parsing the given string. |
static HttpEntityTagList |
parseEntityTagList(java.lang.String strval)
Build an entity tag list object by parsing the given string. |
static HttpEntityTag |
parseETag(java.lang.String strval)
Build an entity tag object by parsing the given string. |
static HttpInteger |
parseInteger(java.lang.String strval)
Build an integer object by parsing the given string. |
static HttpMimeType |
parseMimeType(java.lang.String strval)
Build an MIME type object by parsing the given string. |
static HttpRange |
parseRange(java.lang.String strval)
Build a range object by parsing the given string. |
static HttpRangeList |
parseRangeList(java.lang.String strval)
Build a list of ranges object by parsing the given string. |
static HttpSetCookieList |
parseSetCookieList(java.lang.String strval)
Build a list of set cookies object by parsing the given string. |
static HttpString |
parseString(java.lang.String strval)
Build a String object by parsing the given string. |
static HttpTokenList |
parseTokenList(java.lang.String strval)
Build a list of string object by parsing the given string. |
static HttpWarning |
parseWarning(java.lang.String strval)
Build a warning object by parsing the given string. |
static HttpWarningList |
parseWarningList(java.lang.String strval)
Build a list of warnings object by parsing the given string. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public HttpFactory()
Method Detail |
---|
public static HttpAccept makeAccept(MimeType type, double quality)
Accept
header clause.
type
- The MIME type that you will accept.quality
- The quality you are willing to set to that MIME type.
HttpAccept
public static HttpAccept makeAccept(MimeType type)
Accept
header clause.
This will be assigned the default 1.0 quality.
type
- The MIME type that you will accept.
HttpAccept
public static HttpAccept parseAccept(java.lang.String strval)
strval
- The String to parse.
public static HttpAcceptList makeAcceptList(HttpAccept[] accepts)
Accept
header.
accepts
- The various accept clauses, as build through calls to
makeAccept
and gathered in an array, or null
to create an empty list.
HttpAcceptList
public static HttpAcceptList parseAcceptList(java.lang.String strval)
strval
- The String to parse.
public static HttpAcceptCharset makeAcceptCharset(java.lang.String charset, double quality)
Accept-Charset
header clause.
charset
- The accepted charset.quality
- The quality under which this charset is accepted.
HttpAcceptCharset
public static HttpAcceptCharset makeAcceptCharset(java.lang.String charset)
Accept-Charset
header clause.
Uses the default 1.0 quality.
charset
- The accepted charset.
HttpAcceptCharset
public static HttpAcceptCharset parseAcceptCharset(java.lang.String strval)
strval
- The String to parse.
public static HttpAcceptCharsetList makeAcceptCharsetList(HttpAcceptCharset[] charsets)
Accept-Charset
header.
charsets
- A list of accepted charsets, encoded as an array
or null to create an empty list.
HttpAcceptCharsetList
public static HttpAcceptCharsetList parseAcceptCharsetList(java.lang.String strval)
strval
- The String to parse.
public static HttpAcceptEncoding makeAcceptEncoding(java.lang.String enc, double quality)
Accept-Encoding
header clause.
enc
- The accepted encoding.quality
- The quality at which this encoding is accepted.
HttpAcceptEncoding
public static HttpAcceptEncoding makeAcceptEncoding(java.lang.String enc)
Accept-Encoding
header clause.
Uses the default 1.0 quality.
enc
- The accepted encoding.
HttpAcceptEncoding
public static HttpAcceptEncoding parseAcceptEncoding(java.lang.String strval)
strval
- The String to parse.
public static HttpAcceptEncodingList makeAcceptEncodingList(HttpAcceptEncoding[] encs)
Accept-Encoding
header.
langs
- A list of accepted encodings, encoded as an array, or
null to create an empty list.public static HttpAcceptEncodingList parseAcceptEncodingList(java.lang.String strval)
strval
- The String to parse.
public static HttpAcceptLanguage makeAcceptLanguage(java.lang.String lang, double quality)
Accept-Language
header clause.
lang
- The accepted language.quality
- The quality at which this language is accepted.
HttpAcceptLanguage
public static HttpAcceptLanguage makeAcceptLanguage(java.lang.String lang)
Accept-Language
header clause.
Uses the default 1.0 quality.
lang
- The accepted language.
HttpAcceptLanguage
public static HttpAcceptLanguage parseAcceptLanguage(java.lang.String strval)
strval
- The String to parse.
public static HttpAcceptLanguageList makeAcceptLanguageList(HttpAcceptLanguage[] langs)
Accept-Language
header.
langs
- A list of accepted languages, encoded as an array, or
null to create an empty list.public static HttpAcceptLanguageList parseAcceptLanguageList(java.lang.String strval)
strval
- The String to parse.
public static HttpBag makeBag(java.lang.String name)
name
- The name of the bag to construct.
HttpBag
public static HttpBag parseBag(java.lang.String strval)
strval
- The String to parse.
public static HttpCacheControl makeCacheControl()
HttpCacheControl
public static HttpCacheControl parseCacheControl(java.lang.String strval)
strval
- The String to parse.
public static HttpChallenge makeChallenge(java.lang.String scheme)
scheme
- The scheme used by that challenge.
HttpChallenge
public static HttpChallenge parseChallenge(java.lang.String strval)
strval
- The String to parse.
public static HttpContentRange makeContentRange(java.lang.String unit, int firstpos, int lastpos, int length)
unit
- The unit of that range.firstpos
- The first position of that range (can be -1
to indicate a postfix range.lastpost
- The last position of that range (can be -1
to indicate a prefix range).length
- The full length of the entity from which that range was
taken.
HttpContentRange
public static HttpContentRange parseContentRange(java.lang.String strval)
strval
- The String to parse.
public static HttpCookie makeCookie(java.lang.String name, java.lang.String value)
name
- The name of that cookie.value
- The value of that cookie.
HttpCookie
public static HttpCookieList makeCookieList(HttpCookie[] cookies)
cookies
- The cookies to be added to the list, may be
null to create an empty list.
HttpCookieList
public static HttpCookieList parseCookieList(java.lang.String strval)
strval
- The String to parse.
public static HttpCredential makeCredential(java.lang.String scheme)
scheme
- The scheme for that credentials.
HttpCredential
public static HttpCredential parseCredential(java.lang.String strval)
strval
- The String to parse.
public static HttpDate makeDate(long date)
date
- The date, given in milliseconds since Java epoch.
HttpDate
public static HttpDate makeDate()
HttpDate
public static HttpDate parseDate(java.lang.String strval)
strval
- The String to parse.
public static HttpEntityTag makeETag(boolean isWeak, java.lang.String tag)
isWeak
- Is this a weak entity tag.tag
- The tag encoded as a String.
HttpEntityTag
public static HttpEntityTag parseETag(java.lang.String strval)
strval
- The String to parse.
public static HttpEntityTagList makeETagList(HttpEntityTag[] tags)
tags
- A list of enetity tags, encoded as an array, or
null to create an empty list.
HttpEntityTagList
public static HttpEntityTagList parseEntityTagList(java.lang.String strval)
strval
- The String to parse.
public static HttpInteger makeInteger(int i)
i
- The integer to wrap for HTTP transportation.
HttpInteger
public static HttpInteger parseInteger(java.lang.String strval)
strval
- The String to parse.
public static HttpMimeType makeMimeType(MimeType type)
type
- The MIME type to wrap.
HttpMimeType
public static HttpMimeType parseMimeType(java.lang.String strval)
strval
- The String to parse.
public static HttpRange makeRange(java.lang.String unit, int firstpos, int lastpos)
unit
- The units in which that byte range is measured.firstpos
- The first position of requested byte range.lastpos
- The last position of requested byte range.
HttpRange
public static HttpRange parseRange(java.lang.String strval)
strval
- The String to parse.
public static HttpRangeList makeRangeList(HttpRange[] ranges)
ranges
- A list of ranges, encoded as an array, or
null to create an empty list.
HttpRangeList
public static HttpRangeList parseRangeList(java.lang.String strval)
strval
- The String to parse.
public static HttpSetCookie makeSetCookie(java.lang.String name, java.lang.String value)
Set-Cookie
header.
name
- The name of the cookie we are requesting to be set.value
- It's value.
HttpSetCookie
public static HttpSetCookieList makeSetCookieList(HttpSetCookie[] setcookies)
setcookies
- A list of set cookie commands, encoded as an
array, or null to build an empty list.
HttpSetCookieList
public static HttpSetCookieList parseSetCookieList(java.lang.String strval)
strval
- The String to parse.
public static HttpString makeString(java.lang.String str)
str
- The String (or token) to wrap.
HttpString
public static HttpString parseString(java.lang.String strval)
strval
- The String to parse.
public static HttpTokenList makeStringList(java.lang.String[] list)
list
- The list of strings, encoded as an array, or null
to create an empty list.
HttpTokenList
public static HttpTokenList makeStringList(java.lang.String item)
item
- The item to be added to the list.
HttpTokenList
public static HttpTokenList parseTokenList(java.lang.String strval)
strval
- The String to parse.
public static HttpWarning makeWarning(int status, java.lang.String agent, java.lang.String text)
status
- The warning status code.agent
- The agent generating that warning.text
- The text for the warning.
HttpWarning
public static HttpWarning makeWarning(int status)
status
- The warning status code.
HttpWarning
public static HttpWarning parseWarning(java.lang.String strval)
strval
- The String to parse.
public static HttpWarningList makeWarningList(HttpWarning[] warnings)
Warning
header.
warnings
- A list of warning encoded as an array, or
null to get an empty list.
HttpWarningList
public static HttpWarningList parseWarningList(java.lang.String strval)
strval
- The String to parse.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |