Class w3c.jigsaw.http.Request
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class w3c.jigsaw.http.Request

java.lang.Object
   |
   +----w3c.mime.MIMEHeaders
           |
           +----w3c.jigsaw.http.Request

public class Request
extends MIMEHeaders
this class extends the normal MIMEHeader object to cope with HTTP request. One subtely here: note how each field acessor never throws an exception, but rather is provided with a default value: this is in the hope that sometime, HTTP will not require all the parsing it requires right now.

Variable Index

 o client

Method Index

 o getAccept(Accept[])
Get the request accepted MIME types.
 o getAcceptEncodings(String[])
Get the request accept-encodings.
 o getAcceptLanguage()
 o getAcceptLanguage(Language[])
Get the list of accepted languages for this request.
 o getAuthorization()
 o getAuthorization(String)
Get any authorization information associated with the request.
 o getClient()
Get the client of this request.
 o getConnection(String)
Get this request connection header.
 o getContentLength()
 o getContentLength(int)
Get the request content length.
 o getContentType()
 o getContentType(MIMEType)
Get the request content type.
 o getFieldBag(String)
 o getFieldBag(String, Bag)
HTTP defines a new format for header value, namely bag.
 o getHTTPVersion()
 o getHTTPVersion(String)
Get the String version of this request.
 o getIfModifiedSince()
 o getIfModifiedSince(long)
Get this request if-modified-since header field value.
 o getInputStream()
Get this request input stream.
 o getMethod()
 o getMethod(String)
Get the name of the method of this request.
 o getProxyConnection(String)
Get the proxy connection header for this request.
 o getQueryString()
 o getQueryString(String)
Get this request query string.
 o getURI()
 o getURI(String)
Get the request requested URI.
 o getUser(String)
Get the authentifuiied user behind this request.
 o makeReply(int)
 o makeReply(Integer)
Make an empty Reply object matching this request version.
 o parseBag(String)
Parse a Bag formatted header.
 o parseSingleBag(PushbackInputStream)
 o setUser(String)
Mark this user as being authorizedf for the request.
 o unescape(String)
Unescape a HTTP escaped string

Variables

 o client
  protected Client client

Methods

 o unescape
  public static String unescape(String s)
Unescape a HTTP escaped string
Parameters:
s - The string to be unescaped
Returns:
the unescaped string.
 o getContentType
  public MIMEType getContentType(MIMEType def)
Get the request content type.
Parameters:
def - The default return value.
Returns:
A MIMEType object giving the request content type, or the provided default if content-type isn't properly defined.
See Also:
MIMEType
 o getContentType
  public MIMEType getContentType()
 o getContentLength
  public int getContentLength(int def)
Get the request content length.
Parameters:
def - The default value.
Returns:
An integer, giving the content length, or the provided default value if not properly defined.
 o getContentLength
  public int getContentLength()
 o getAcceptEncodings
  public String[] getAcceptEncodings(String def[])
Get the request accept-encodings.
Parameters:
def - The default value.
Returns:
An array of String, each string being a content encoding scheme, or the provided default value.
 o getAccept
  public Accept[] getAccept(Accept def[])
Get the request accepted MIME types.
Parameters:
def - The default value.
Returns:
An array of instances of Accept, or the provided default value.
See Also:
Accept
 o getIfModifiedSince
  public long getIfModifiedSince(long def)
Get this request if-modified-since header field value.
Parameters:
def - The default value.
Returns:
A long, giving the header's value, or the default value.
Throws: HTTPException
If no such header was defined.
 o getIfModifiedSince
  public long getIfModifiedSince()
 o getURI
  public String getURI(String def)
Get the request requested URI.
Parameters:
def - The default value.
Returns:
A String giving the unparsed requested URI, or the provided default value.
 o getURI
  public String getURI()
 o getInputStream
  public InputStream getInputStream()
Get this request input stream.
Returns:
An instance of InputStream, or null if the request doesn't have an input stream.
 o getAcceptLanguage
  public Language[] getAcceptLanguage(Language def[])
Get the list of accepted languages for this request.
Parameters:
def - The default value.
Returns:
An array of Language objects, or the provided default value.
See Also:
Language
 o getAcceptLanguage
  public Language[] getAcceptLanguage()
 o getMethod
  public String getMethod(String def)
Get the name of the method of this request.
Returns:
A String giving the name of the method, or the provided default value.
 o getMethod
  public String getMethod()
 o getAuthorization
  public String getAuthorization(String def)
Get any authorization information associated with the request.
Parameters:
def - The default value.
Returns:
A String containing the autorization informations, or the default value.
 o getAuthorization
  public String getAuthorization()
 o getConnection
  public String getConnection(String def)
Get this request connection header.
Returns:
The String value of the connectionm header, or the provided default value.
 o getProxyConnection
  public String getProxyConnection(String def)
Get the proxy connection header for this request.
Parameters:
def - The default value.
Returns:
A String giving the value of the header, or the provided default value.
 o getQueryString
  public String getQueryString(String def)
Get this request query string.
Parameters:
def - The default value.
Returns:
A String giving the value of the query string for this request or the provided default value.
 o getQueryString
  public String getQueryString()
 o getHTTPVersion
  public String getHTTPVersion(String def)
Get the String version of this request.
Parameters:
def - The default value.
Returns:
A String describing the version of the request.
 o getHTTPVersion
  public String getHTTPVersion()
 o parseSingleBag
  protected Bag parseSingleBag(PushbackInputStream in) throws HTTPException
 o parseBag
  protected Bag parseBag(String bagstr) throws HTTPException
Parse a Bag formatted header. I wonder why PEP specifies that headers are a sequence of bags, rather than one single bag.
Parameters:
bagstr - The string MIME compliant representation of the bag.
Returns:
An instance of Bag, describing the Bag value.
See Also:
Bag
 o getFieldBag
  public Bag getFieldBag(String name,
                         Bag def)
HTTP defines a new format for header value, namely bag. This method returns the value of a named header as a parsed Bag object.
Parameters:
name - The name of the header.
def - The default value to be returned if undefined.
Returns:
A bag object.
See Also:
Bag
 o getFieldBag
  public Bag getFieldBag(String name)
 o setUser
  public void setUser(String user)
Mark this user as being authorizedf for the request.
Parameters:
user - The name under wich the user has been authentified.
 o getUser
  public String getUser(String def)
Get the authentifuiied user behind this request.
Parameters:
def - The default value if no user authentified.
Returns:
A String giving the user name, or the default value.
 o makeReply
  public Reply makeReply(Integer status)
Make an empty Reply object matching this request version.
Parameters:
status - The status of the reply.
 o makeReply
  public Reply makeReply(int status)
 o getClient
  public Client getClient()
Get the client of this request.

All Packages  Class Hierarchy  This Package  Previous  Next  Index