All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class w3c.www.http.HttpFactory

java.lang.Object
   |
   +----w3c.www.http.HttpFactory

public class HttpFactory
extends Object
Use this class to create pre-defined header values of various kind.


Constructor Index

 o HttpFactory()

Method Index

 o makeAccept(MimeType)
Create an Accept header clause.
 o makeAccept(MimeType, double)
Create an Accept header clause.
 o makeAcceptCharset(String)
Build an Accept-Charset header clause.
 o makeAcceptCharset(String, double)
Build an Accept-Charset header clause.
 o makeAcceptCharsetList(HttpAcceptCharset[])
Build a list of accepted charset for the Accept-Charset header.
 o makeAcceptLanguage(String)
Build an Accept-Language header clause.
 o makeAcceptLanguage(String, double)
Build an Accept-Language header clause.
 o makeAcceptLanguageList(HttpAcceptLanguage[])
Build a list of accept language clauses for the Accept-Language header.
 o makeAcceptList(HttpAccept[])
Build a list of accept clause, ready for the Accept header.
 o makeBag(String)
Build a empty bag instance.
 o makeCacheControl()
Build an empty cache control directive.
 o makeChallenge(String)
Build a challenge requesting authorization from a client.
 o makeContentRange(String, int, int, int)
Build the description of a HTTP content range.
 o makeCookie(String, String)
Build a single cookie value.
 o makeCookieList(HttpCookie[])
Build a list of cookies out of a set of cookies.
 o makeCredential(String)
Build credential informations.
 o makeDate()
Build an HTTP date object representing the current time.
 o makeDate(long)
Build an HTTP date object.
 o makeETag(boolean, String)
Build an entity tag object.
 o makeETagList(HttpEntityTag[])
Build an entity tag list.
 o makeInteger(int)
Build a wrapper for an HTTP integer.
 o makeMimeType(MimeType)
Build a wrapper for a MIME type suitable for HTTP transportation.
 o makeRange(String, int, int)
Build an object representing an HTTP range.
 o makeRangeList(HttpRange[])
Build a list of ranges.
 o makeSetCookie(String, String)
Build a set cookie clause for the Set-Cookie header.
 o makeSetCookieList(HttpSetCookie[])
Build a list of set cookies commands.
 o makeString(String)
Build a wrapper for a String, for HTTP transportation.
 o makeStringList(String)
Build a list of one string.
 o makeStringList(String[])
Build a list of strings.
 o makeWarning(int)
Build an HTTP Warning object.
 o makeWarning(int, String, String)
Build an HTTP Warning object.
 o makeWarningList(HttpWarning[])
Build a list of warnings for the Warning header.
 o parseAccept(String)
Build an accept object by parsing the given string.
 o parseAcceptCharset(String)
Build an accept charset object by parsing the given string.
 o parseAcceptCharsetList(String)
Build an accept charset list object by parsing the given string.
 o parseAcceptLanguage(String)
Build an accept language object by parsing the given string.
 o parseAcceptLanguageList(String)
Build an accept language list object by parsing the given string.
 o parseAcceptList(String)
Build an accept list object by parsing the given string.
 o parseBag(String)
Build a bag object by parsing the given string.
 o parseCacheControl(String)
Build a cache control object by parsing the given string.
 o parseChallenge(String)
Build a challenge object by parsing the given string.
 o parseContentRange(String)
Build a content range object by parsing the given string.
 o parseCookieList(String)
Build a cookie list object by parsing the given string.
 o parseCredential(String)
Build a credential object by parsing the given string.
 o parseDate(String)
Build a date object by parsing the given string.
 o parseEntityTagList(String)
Build an entity tag list object by parsing the given string.
 o parseETag(String)
Build an entity tag object by parsing the given string.
 o parseInteger(String)
Build an integer object by parsing the given string.
 o parseMimeType(String)
Build an MIME type object by parsing the given string.
 o parseRange(String)
Build a range object by parsing the given string.
 o parseRangeList(String)
Build a list of ranges object by parsing the given string.
 o parseSetCookieList(String)
Build a list of set cookies object by parsing the given string.
 o parseString(String)
Build a String object by parsing the given string.
 o parseTokenList(String)
Build a list of string object by parsing the given string.
 o parseWarning(String)
Build a warning object by parsing the given string.
 o parseWarningList(String)
Build a list of warnings object by parsing the given string.

Constructors

 o HttpFactory
 public HttpFactory()

Methods

 o makeAccept
 public static HttpAccept makeAccept(MimeType type,
                                     double quality)
Create an Accept header clause.

Parameters:
type - The MIME type that you will accept.
quality - The quality you are willing to set to that MIME type.
Returns:
An instance of HttpAccept.
See Also:
HttpAccept
 o makeAccept
 public static HttpAccept makeAccept(MimeType type)
Create an Accept header clause. This will be assigned the default 1.0 quality.

Parameters:
type - The MIME type that you will accept.
Returns:
An instance of HttpAccept.
See Also:
HttpAccept
 o parseAccept
 public static HttpAccept parseAccept(String strval)
Build an accept object by parsing the given string.

Parameters:
strval - The String to parse.
Returns:
An HttpAccept instance.
 o makeAcceptList
 public static HttpAcceptList makeAcceptList(HttpAccept accepts[])
Build a list of accept clause, ready for the Accept header.

Parameters:
accepts - The various accept clauses, as build through calls to makeAccept and gathered in an array, or null to create an empty list.
Returns:
An instance of HttpAcceptList.
See Also:
HttpAcceptList
 o parseAcceptList
 public static HttpAcceptList parseAcceptList(String strval)
Build an accept list object by parsing the given string.

Parameters:
strval - The String to parse.
Returns:
An HttpAcceptList instance.
 o makeAcceptCharset
 public static HttpAcceptCharset makeAcceptCharset(String charset,
                                                   double quality)
Build an Accept-Charset header clause.

Parameters:
charset - The accepted charset.
quality - The quality under which this charset is accepted.
Returns:
An instance of HttpAcceptCharset.
See Also:
HttpAcceptCharset
 o makeAcceptCharset
 public static HttpAcceptCharset makeAcceptCharset(String charset)
Build an Accept-Charset header clause. Uses the default 1.0 quality.

Parameters:
charset - The accepted charset.
Returns:
An instance of HttpAcceptCharset.
See Also:
HttpAcceptCharset
 o parseAcceptCharset
 public static HttpAcceptCharset parseAcceptCharset(String strval)
Build an accept charset object by parsing the given string.

Parameters:
strval - The String to parse.
Returns:
An HttpAcceptCharset instance.
 o makeAcceptCharsetList
 public static HttpAcceptCharsetList makeAcceptCharsetList(HttpAcceptCharset charsets[])
Build a list of accepted charset for the Accept-Charset header.

Parameters:
charsets - A list of accepted charsets, encoded as an array or null to create an empty list.
Returns:
An instance of HttpAcceptCharsetList.
See Also:
HttpAcceptCharsetList
 o parseAcceptCharsetList
 public static HttpAcceptCharsetList parseAcceptCharsetList(String strval)
Build an accept charset list object by parsing the given string.

Parameters:
strval - The String to parse.
Returns:
An HttpAcceptCharsetList instance.
 o makeAcceptLanguage
 public static HttpAcceptLanguage makeAcceptLanguage(String lang,
                                                     double quality)
Build an Accept-Language header clause.

Parameters:
lang - The accepted language.
quality - The quality at which this language is accepted.
Returns:
An instance of HttpAcceptLanguage.
See Also:
HttpAcceptLanguage
 o makeAcceptLanguage
 public static HttpAcceptLanguage makeAcceptLanguage(String lang)
Build an Accept-Language header clause. Uses the default 1.0 quality.

Parameters:
lang - The accepted language.
Returns:
An instance of HttpAcceptLanguage.
See Also:
HttpAcceptLanguage
 o parseAcceptLanguage
 public static HttpAcceptLanguage parseAcceptLanguage(String strval)
Build an accept language object by parsing the given string.

Parameters:
strval - The String to parse.
Returns:
An HttpAcceptLanguage instance.
 o makeAcceptLanguageList
 public static HttpAcceptLanguageList makeAcceptLanguageList(HttpAcceptLanguage langs[])
Build a list of accept language clauses for the Accept-Language header.

Parameters:
langs - A list of accepted languages, encoded as an array, or null to create an empty list.
 o parseAcceptLanguageList
 public static HttpAcceptLanguageList parseAcceptLanguageList(String strval)
Build an accept language list object by parsing the given string.

Parameters:
strval - The String to parse.
Returns:
An HttpAcceptLanguageList instance.
 o makeBag
 public static HttpBag makeBag(String name)
Build a empty bag instance. Bags are used in PEP and PICS.

Parameters:
name - The name of the bag to construct.
Returns:
An empty bag instance.
See Also:
HttpBag
 o parseBag
 public static HttpBag parseBag(String strval)
Build a bag object by parsing the given string.

Parameters:
strval - The String to parse.
Returns:
An HttpBag instance.
 o makeCacheControl
 public static HttpCacheControl makeCacheControl()
Build an empty cache control directive.

Returns:
An instance of HttpCacheControl, with default settings.
See Also:
HttpCacheControl
 o parseCacheControl
 public static HttpCacheControl parseCacheControl(String strval)
Build a cache control object by parsing the given string.

Parameters:
strval - The String to parse.
Returns:
An HttpCacheControl instance.
 o makeChallenge
 public static HttpChallenge makeChallenge(String scheme)
Build a challenge requesting authorization from a client.

Parameters:
scheme - The scheme used by that challenge.
Returns:
An HttpChallenge instance.
See Also:
HttpChallenge
 o parseChallenge
 public static HttpChallenge parseChallenge(String strval)
Build a challenge object by parsing the given string.

Parameters:
strval - The String to parse.
Returns:
An HttpChallenge instance.
 o makeContentRange
 public static HttpContentRange makeContentRange(String unit,
                                                 int firstpos,
                                                 int lastpos,
                                                 int length)
Build the description of a HTTP content range.

Parameters:
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.
Returns:
An instance of HttpContentRange.
See Also:
HttpContentRange
 o parseContentRange
 public static HttpContentRange parseContentRange(String strval)
Build a content range object by parsing the given string.

Parameters:
strval - The String to parse.
Returns:
An HttpContantRange instance.
 o makeCookie
 public static HttpCookie makeCookie(String name,
                                     String value)
Build a single cookie value.

Parameters:
name - The name of that cookie.
value - The value of that cookie.
Returns:
An instance of HttpCookie.
See Also:
HttpCookie
 o makeCookieList
 public static HttpCookieList makeCookieList(HttpCookie cookies[])
Build a list of cookies out of a set of cookies.

Parameters:
cookies - The cookies to be added to the list, may be null to create an empty list.
Returns:
An instance of HttpCookieList.
See Also:
HttpCookieList
 o parseCookieList
 public static HttpCookieList parseCookieList(String strval)
Build a cookie list object by parsing the given string.

Parameters:
strval - The String to parse.
Returns:
An HttpCookieList instance.
 o makeCredential
 public static HttpCredential makeCredential(String scheme)
Build credential informations.

Parameters:
scheme - The scheme for that credentials.
Returns:
An instance of HttpCredential.
See Also:
HttpCredential
 o parseCredential
 public static HttpCredential parseCredential(String strval)
Build a credential object by parsing the given string.

Parameters:
strval - The String to parse.
Returns:
An HttpCredential instance.
 o makeDate
 public static HttpDate makeDate(long date)
Build an HTTP date object.

Parameters:
date - The date, given in milliseconds since Java epoch.
Returns:
An instance of HttpDate.
See Also:
HttpDate
 o makeDate
 public static HttpDate makeDate()
Build an HTTP date object representing the current time.

Returns:
An instance of HttpDate.
See Also:
HttpDate
 o parseDate
 public static HttpDate parseDate(String strval)
Build a date object by parsing the given string.

Parameters:
strval - The String to parse.
Returns:
An HttpDate instance.
 o makeETag
 public static HttpEntityTag makeETag(boolean isWeak,
                                      String tag)
Build an entity tag object.

Parameters:
isWeak - Is this a weak entity tag.
tag - The tag encoded as a String.
Returns:
An instance of HttpEntityTag.
See Also:
HttpEntityTag
 o parseETag
 public static HttpEntityTag parseETag(String strval)
Build an entity tag object by parsing the given string.

Parameters:
strval - The String to parse.
Returns:
An HttpEntityTag instance.
 o makeETagList
 public static HttpEntityTagList makeETagList(HttpEntityTag tags[])
Build an entity tag list.

Parameters:
tags - A list of enetity tags, encoded as an array, or null to create an empty list.
Returns:
An instance of HttpEntityTagList.
See Also:
HttpEntityTagList
 o parseEntityTagList
 public static HttpEntityTagList parseEntityTagList(String strval)
Build an entity tag list object by parsing the given string.

Parameters:
strval - The String to parse.
Returns:
An HttpEntityTagList instance.
 o makeInteger
 public static HttpInteger makeInteger(int i)
Build a wrapper for an HTTP integer.

Parameters:
i - The integer to wrap for HTTP transportation.
Returns:
An instance of HttpInteger.
See Also:
HttpInteger
 o parseInteger
 public static HttpInteger parseInteger(String strval)
Build an integer object by parsing the given string.

Parameters:
strval - The String to parse.
Returns:
An HttpInteger instance.
 o makeMimeType
 public static HttpMimeType makeMimeType(MimeType type)
Build a wrapper for a MIME type suitable for HTTP transportation.

Parameters:
type - The MIME type to wrap.
Returns:
An instance of HttpMimeType.
See Also:
HttpMimeType
 o parseMimeType
 public static HttpMimeType parseMimeType(String strval)
Build an MIME type object by parsing the given string.

Parameters:
strval - The String to parse.
Returns:
An HttpMimeType instance.
 o makeRange
 public static HttpRange makeRange(String unit,
                                   int firstpos,
                                   int lastpos)
Build an object representing an HTTP range.

Parameters:
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.
Returns:
An instance of HttpRange.
See Also:
HttpRange
 o parseRange
 public static HttpRange parseRange(String strval)
Build a range object by parsing the given string.

Parameters:
strval - The String to parse.
Returns:
An HttpRange instance.
 o makeRangeList
 public static HttpRangeList makeRangeList(HttpRange ranges[])
Build a list of ranges.

Parameters:
ranges - A list of ranges, encoded as an array, or null to create an empty list.
Returns:
An instance of HttprangeList.
See Also:
HttpRangeList
 o parseRangeList
 public static HttpRangeList parseRangeList(String strval)
Build a list of ranges object by parsing the given string.

Parameters:
strval - The String to parse.
Returns:
An HttpRangeList instance.
 o makeSetCookie
 public static HttpSetCookie makeSetCookie(String name,
                                           String value)
Build a set cookie clause for the Set-Cookie header.

Parameters:
name - The name of the cookie we are requesting to be set.
value - It's value.
Returns:
An instance of HttpSetCookie.
See Also:
HttpSetCookie
 o makeSetCookieList
 public static HttpSetCookieList makeSetCookieList(HttpSetCookie setcookies[])
Build a list of set cookies commands.

Parameters:
setcookies - A list of set cookie commands, encoded as an array, or null to build an empty list.
Returns:
An instance of HttpStCookieList.
See Also:
HttpSetCookieList
 o parseSetCookieList
 public static HttpSetCookieList parseSetCookieList(String strval)
Build a list of set cookies object by parsing the given string.

Parameters:
strval - The String to parse.
Returns:
An HttpSetCookieList instance.
 o makeString
 public static HttpString makeString(String str)
Build a wrapper for a String, for HTTP transportation.

Parameters:
str - The String (or token) to wrap.
Returns:
An instance of HttpString.
See Also:
HttpString
 o parseString
 public static HttpString parseString(String strval)
Build a String object by parsing the given string.

Parameters:
strval - The String to parse.
Returns:
An HttpString instance.
 o makeStringList
 public static HttpTokenList makeStringList(String list[])
Build a list of strings.

Parameters:
list - The list of strings, encoded as an array, or null to create an empty list.
Returns:
An instance of HttpTokenList.
See Also:
HttpTokenList
 o makeStringList
 public static HttpTokenList makeStringList(String item)
Build a list of one string.

Parameters:
item - The item to be added to the list.
Returns:
An instance of HttpTokenList.
See Also:
HttpTokenList
 o parseTokenList
 public static HttpTokenList parseTokenList(String strval)
Build a list of string object by parsing the given string.

Parameters:
strval - The String to parse.
Returns:
An HttpTokenList instance.
 o makeWarning
 public static HttpWarning makeWarning(int status,
                                       String agent,
                                       String text)
Build an HTTP Warning object.

Parameters:
status - The warning status code.
agent - The agent generating that warning.
text - The text for the warning.
Returns:
An instance of HttpWarning.
See Also:
HttpWarning
 o makeWarning
 public static HttpWarning makeWarning(int status)
Build an HTTP Warning object.

Parameters:
status - The warning status code.
Returns:
An instance of HttpWarning.
See Also:
HttpWarning
 o parseWarning
 public static HttpWarning parseWarning(String strval)
Build a warning object by parsing the given string.

Parameters:
strval - The String to parse.
Returns:
An HttpWarning instance.
 o makeWarningList
 public static HttpWarningList makeWarningList(HttpWarning warnings[])
Build a list of warnings for the Warning header.

Parameters:
warnings - A list of warning encoded as an array, or null to get an empty list.
Returns:
An instance of HttpWarningList.
See Also:
HttpWarningList
 o parseWarningList
 public static HttpWarningList parseWarningList(String strval)
Build a list of warnings object by parsing the given string.

Parameters:
strval - The String to parse.
Returns:
An HttpWarningList instance.

All Packages  Class Hierarchy  This Package  Previous  Next  Index