    All Packages  Class Hierarchy  This Package  Previous  Next  Index

# Class org.w3c.www.http.HttpRequestMessage

    java.lang.Object
       |
       +----org.w3c.www.http.HttpMessage
               |
               +----org.w3c.www.http.HttpEntityMessage
                       |
                       +----org.w3c.www.http.HttpRequestMessage

public class HttpRequestMessage
extends HttpEntityMessage

##

H_ACCEPT
H_ACCEPT_CHARSET
H_ACCEPT_ENCODING
H_ACCEPT_LANGUAGE
H_AUTHORIZATION
H_EXPECT
H_FROM
H_HOST
H_IF_MATCH
H_IF_MODIFIED_SINCE
H_IF_NONE_MATCH
H_IF_RANGE
H_IF_UNMODIFIED_SINCE
H_MAX_FORWARDS
H_PROXY_AUTHORIZATION
H_RANGE
H_REFERER
H_TE
H_USER_AGENT
method
  The method to execute on the target resource.
proxy
  The proxy to use for that request, if any.
sProxy
url
  The target resource, identified by its URL.

##

HttpRequestMessage()
HttpRequestMessage(MimeParser)

##

dump(OutputStream)
getAccept()
  Get this request accept list.
getAcceptCharset()
  Get the list of accepted charsets for this request.
getAcceptEncoding()
  Get the list of accepted encodings.
getAcceptLanguage()
  Get the list of accepted languages for this request.
getAuthorization()
  Get the authorization associated with this request.
getExpect()
  Get this request's Expect header value.
getFrom()
  Get the originator (from header value) of the request.
getHost()
  Get the host header.
getIfMatch()
  Get the conditional matching set of entity tags.
getIfModifiedSince()
  Get the if-modified-since conditional.
getIfNoneMatch()
  Get the conditional none matching entity tags.
getIfRange()
  Get the if-range conditional if any.
getIfUnmodifiedSince()
  Get the if unmodified since conditional date.
getMaxForwards()
  Get the maximum allowed count of hops for the request.
getMaxStale()
  Get the `max-stale` directive value of the cache control header.
getMethod()
  Get this request's method.
getMinFresh()
  Get the `min-fresh` directive value of the cache control header.
getProxy()
  Get the proxy to use for that request.
getProxyAuthorization()
  Get the authorization associated with this request.
getRange()
  Get the ranges queried by this request.
getReferer()
  Get the referer of the request.
getTarget()
getTE()
  Get the list of restricted transfer encodings.
getURL()
  Get this request's target URI.
getUserAgent()
  Get the user agent String.
hasAuthorization()
  Does this request has some specific authorization infos.
hasProxy()
  Will this request use a proxy when executed ?
main(String[])
notifyBeginParsing(MimeParser)
setAccept(HttpAccept[])
  Set the list of accept clauses attached to this request.
setAcceptCharset(HttpAcceptCharset[])
  Set the list of accepted charsets for this request.
setAcceptEncoding(HttpAcceptEncoding[])
  Set the list of accepted encodings.
setAcceptLanguage(HttpAcceptCharset[])
  Set the list of accepted languages for this request.
setAuthorization(HttpCredential)
  Set the authorization associated with this request.
setExpect(String)
  Set this request's Expect header.
setFrom(String)
  Set the originator of this request.
setHost(String)
  Set the host header value.
setIfMatch(HttpEntityTag[])
  Set the conditional matching set of entity tags.
setIfModifiedSince(long)
  Set the if-modified-since conditional.
setIfNoneMatch(HttpEntityTag[])
  Set the conditional none matching entity tags.
setIfRange(HttpEntityTag)
  Set the if-range header value.
setIfUnmodifiedSince(long)
  Set the if-unmodified-since conditional date.
setMaxForwards(int)
  Set the maximum allowed count of hops for that request.
setMaxStale(int)
  Set the `max-stale` directive value.
setMethod(String)
  Set this request's method.
setMinFresh(int)
  Set the `min-fresh` directive value of the cache control header.
setProxy(URL)
  Set the proxy to use for that request.
setProxyAuthorization(HttpCredential)
  Set the proxy authorization associated with that request.
setRange(HttpRange[])
  Set the ranges queried by this request.
setReferer(String)
  Set the referer of this request.
setTarget(String)
setTE(HttpAcceptEncoding[])
  Set the list of restricted transfer encodings
setURL(URL)
  Set this request URI.
setUserAgent(String)
  Set the user agent description header.
startEmit(OutputStream, int)
  This message is about to be emited, emit the request-line first !

##

H_ACCEPT

     public static int H_ACCEPT

H_ACCEPT_CHARSET

     public static int H_ACCEPT_CHARSET

H_ACCEPT_ENCODING

     public static int H_ACCEPT_ENCODING

H_ACCEPT_LANGUAGE

     public static int H_ACCEPT_LANGUAGE

H_AUTHORIZATION

     public static int H_AUTHORIZATION

H_EXPECT

     public static int H_EXPECT

H_FROM

     public static int H_FROM

H_HOST

     public static int H_HOST

H_IF_MODIFIED_SINCE

     public static int H_IF_MODIFIED_SINCE

H_IF_MATCH

     public static int H_IF_MATCH

H_IF_NONE_MATCH

     public static int H_IF_NONE_MATCH

H_IF_RANGE

     public static int H_IF_RANGE

H_IF_UNMODIFIED_SINCE

     public static int H_IF_UNMODIFIED_SINCE

H_MAX_FORWARDS

     public static int H_MAX_FORWARDS

H_PROXY_AUTHORIZATION

     public static int H_PROXY_AUTHORIZATION

H_RANGE

     public static int H_RANGE

H_REFERER

     public static int H_REFERER

H_TE

     public static int H_TE

H_USER_AGENT

     public static int H_USER_AGENT

method

     protected String method

  The method to execute on the target resource.

url

     protected URL url

  The target resource, identified by its URL.

proxy

     protected URL proxy

  The proxy to use for that request, if any.

sProxy

     protected String sProxy

##

HttpRequestMessage

     public HttpRequestMessage(MimeParser parser)

HttpRequestMessage

     public HttpRequestMessage()

##

startEmit

     protected void startEmit(OutputStream out,
                              int what) throws IOException

  This message is about to be emited, emit the request-line first !

  Parameters:
    out - The output stream to emit the request to.
  Throws: IOException
    If some IO error occured while emiting the request.
  Overrides:
    startEmit in class HttpMessage

dump

     public void dump(OutputStream out)

  Overrides:
    dump in class HttpMessage

notifyBeginParsing

     public boolean notifyBeginParsing(MimeParser parser) throws HttpParserException, IOException

  Returns:
    A boolean true if the MIME parser should stop parsing, false otherwise.
  Throws: IOException
    If some IO error occured while reading the stream.
  Throws: HttpParserException
    if parsing failed.
  Overrides:
    notifyBeginParsing in class HttpMessage

setTarget

     protected void setTarget(String target)

getTarget

     protected String getTarget()

getMethod

     public String getMethod()

  Get this request's method.

  Returns:
    The request method, as a String.

setMethod

     public void setMethod(String method)

  Set this request's method.

  Parameters:
    mth - The request method.

getURL

     public URL getURL()

  Get this request's target URI. This will only return the absolute path of the requested resource, even if the actual request came with the full path as an URI.

  Returns:
    An URL instance, or null if undefined.

setURL

     public void setURL(URL url)

  Set this request URI. The provided URI should only include the absolute path of the target request, see the `setHost` method for how to set the actual host of the target resource.

  Parameters:
    url - The target URL of the request, as an URL instance.

getMinFresh

     public int getMinFresh()

  Get the `min-fresh` directive value of the cache control header.

  Returns:
    The min-fresh value, as a number of seconds, or -1 if undefined.

setMinFresh

     public void setMinFresh(int minfresh)

  Set the `min-fresh` directive value of the cache control header.

  Parameters:
    minfresh - The min-fresh value, in seconds, or -1 to reset value.

getMaxStale

     public int getMaxStale()

  Get the `max-stale` directive value of the cache control header.

  Returns:
    The max-stale value, as a number of seconds, or -1 if undefined.

setMaxStale

     public void setMaxStale(int maxstale)

  Set the `max-stale` directive value.

  Parameters:
    maxstale - A number of seconds giving the allowed drift for a resource that is no more valid, or -1 to reset the value.

getAccept

     public HttpAccept[] getAccept()

  Get this request accept list.

  Returns:
    A list of Accept clauses encoded as an array of HttpAccept instances, or null if undefined.

setAccept

     public void setAccept(HttpAccept accepts[])

  Set the list of accept clauses attached to this request.

  Parameters:
    accepts - The list of accept clauses encoded as an array of HttpAccept instances, or null to reset the value.

getAcceptCharset

     public HttpAcceptCharset[] getAcceptCharset()

  Get the list of accepted charsets for this request.

  Returns:
    The list of accepted languages encoded as an array of instances of HttpAcceptCharset, or null if undefined.

setAcceptCharset

     public void setAcceptCharset(HttpAcceptCharset charsets[])

  Set the list of accepted charsets for this request.

  Parameters:
    charsets - The list of accepted charsets, encoded as an array of HttpAcceptCharset instances, or null to reset the value.

getAcceptEncoding

     public HttpAcceptEncoding[] getAcceptEncoding()

  Get the list of accepted encodings.

  Returns:
    A list of token describing the accepted encodings, or null if undefined.

setAcceptEncoding

     public void setAcceptEncoding(HttpAcceptEncoding encoding[])

  Set the list of accepted encodings.

  Parameters:
    encodings - The list of accepted encodings, as an array, of HttpAcceptEncoding or null to reset the value.

getAcceptLanguage

     public HttpAcceptLanguage[] getAcceptLanguage()

  Get the list of accepted languages for this request.

  Returns:
    The list of accepted languages encoded as an array of instances of HttpAcceptLanguage, or null if undefined.

setAcceptLanguage

     public void setAcceptLanguage(HttpAcceptCharset langs[])

  Set the list of accepted languages for this request.

  Parameters:
    langs - The list of accepted languages, encoded as an array of HttpAcceptLanguage instances, or null to reset value.

getAuthorization

     public HttpCredential getAuthorization()

  Get the authorization associated with this request.

  Returns:
    An instance of HttpCredential of null if undefined.

setAuthorization

     public void setAuthorization(HttpCredential credentials)

  Set the authorization associated with this request.

  Parameters:
    credentials - The credentials to attach to this request, or null to reset the value.

hasAuthorization

     public boolean hasAuthorization()

  Does this request has some specific authorization infos.

  Returns:
    A boolean.

getFrom

     public String getFrom()

  Get the originator (from header value) of the request.

  Returns:
    The originator description, as a String, or null if undefined.

setFrom

     public void setFrom(String from)

  Set the originator of this request.

  Parameters:
    from - The description of the originator, as an email address, or null to reset the value.

getHost

     public String getHost()

  Get the host header.

  Returns:
    The host header, encoded as a String, or null if undefined.

setHost

     public void setHost(String host)

  Set the host header value.

  Parameters:
    host - The String representing the target host of the request, or null to reset the value.

getIfModifiedSince

     public long getIfModifiedSince()

  Get the if-modified-since conditional.

  Returns:
    A long, giving the If-Modified-Since date value as the number of milliseconds since Java epoch, or -1 if undefined.

setIfModifiedSince

     public void setIfModifiedSince(long ims)

  Set the if-modified-since conditional.

  Parameters:
    ims - The date of last modification, as the number of milliseconds since Java epoch, or -1 to reset the value.

getIfMatch

     public HttpEntityTag[] getIfMatch()

  Get the conditional matching set of entity tags.

  Returns:
    An array of HttpEntityTag instances, or null if undefined.

setIfMatch

     public void setIfMatch(HttpEntityTag etags[])

  Set the conditional matching set of entity tags.

  Parameters:
    etags - An array of HttpEntityTag, one per item in the set, or null to reset the header value.

getIfNoneMatch

     public HttpEntityTag[] getIfNoneMatch()

  Get the conditional none matching entity tags.

  Returns:
    An entity tag list, encoded as an array of HttpEntityTag, or null if undefined.

setIfNoneMatch

     public void setIfNoneMatch(HttpEntityTag etags[])

  Set the conditional none matching entity tags.

  Parameters:
    etags - An array of HttpEntityTag, one per item in the set, or null to reset the value.

getIfRange

     public HttpEntityTag getIfRange()

  Get the if-range conditional if any. Warning: This API doesn't accept `If-Range` header that contains date value (if you want to discuss why, send me email)

  Returns:
    An HttpEntityTag instance, or null if that header is not defined.

setIfRange

     public void setIfRange(HttpEntityTag etag)

  Set the if-range header value.

  Parameters:
    etag - The contional etag, or null to reset previous setting.

getIfUnmodifiedSince

     public long getIfUnmodifiedSince()

  Get the if unmodified since conditional date.

  Returns:
    The date encoded as a long number of milliseconds since Java runtime epoch, or -1 if undefined.

setIfUnmodifiedSince

     public void setIfUnmodifiedSince(long date)

  Set the if-unmodified-since conditional date.

  Parameters:
    date - The date, encoded as the number of milliseconds since Java epoch, or -1 to reset value.

getMaxForwards

     public int getMaxForwards()

  Get the maximum allowed count of hops for the request.

  Returns:
    An integer giving the number of hops, or -1 if undefined.

setMaxForwards

     public void setMaxForwards(int hops)

  Set the maximum allowed count of hops for that request.

  Parameters:
    hops - The hops count, or -1 to reset value.

setProxyAuthorization

     public void setProxyAuthorization(HttpCredential credentials)

  Set the proxy authorization associated with that request.

  Parameters:
    credentials - The credentials, or null to reset the value.

getProxyAuthorization

     public HttpCredential getProxyAuthorization()

  Get the authorization associated with this request.

  Returns:
    An instance of HttpCredential of null if undefined.

getRange

     public HttpRange[] getRange()

  Get the ranges queried by this request.

  Returns:
    A list of ranges, encoded as an array of HttpRange instance or null if undefined.

setRange

     public void setRange(HttpRange ranges[])

  Set the ranges queried by this request.

  Parameters:
    ranges - The list of ranges, encoded as an array of instances of HttpRange, or null to reset the value.

getReferer

     public String getReferer()

  Get the referer of the request.

  Returns:
    A String encoding the referer (generally an URL), or null if undefined.

setReferer

     public void setReferer(String referer)

  Set the referer of this request.

  Parameters:
    referer - The referer of the request, or null to reset the value.

getUserAgent

     public String getUserAgent()

  Get the user agent String.

  Returns:
    The user agent description, as a String, or null if undefined.

setUserAgent

     public void setUserAgent(String ua)

  Set the user agent description header.

  Parameters:
    ua - The description of the user agent emiting the request, or null to reset the value.

getExpect

     public String getExpect()

  Get this request's Expect header value.

  Returns:
    This header as a String.

setExpect

     public void setExpect(String expect)

  Set this request's Expect header.

  Parameters:
    exp - The value of the header (ex: "100-continue".

getTE

     public HttpAcceptEncoding[] getTE()

  Get the list of restricted transfer encodings.

  Returns:
    A list of token describing the restreicted TE, or null if undefined.

setTE

     public void setTE(HttpAcceptEncoding encoding[])

  Set the list of restricted transfer encodings

  Parameters:
    encodings - The list of accepted encodings, as an array, of HttpAcceptEncoding or null to reset the value.

setProxy

     public void setProxy(URL proxy)

  Set the proxy to use for that request.

  Parameters:
    proxy - The proxy's URL, or null to reset value.

getProxy

     public URL getProxy()

  Get the proxy to use for that request.

  Returns:
    The proxy's URL, or null if none is set.

hasProxy

     public boolean hasProxy()

  Will this request use a proxy when executed ?

  Returns:
    A boolean.

main

     public static void main(String args[])

    All Packages  Class Hierarchy  This Package  Previous  Next  Index