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

Class w3c.jigsaw.http.Request

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

public class Request
extends HttpRequestMessage
implements HTTP
this class extends HttpRequestMessage 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
 o in
 o internal
 o keepcon
 o original
 o parser
 o THE_SERVER
The URL that means * for an OPTIONS method.

Constructor Index

 o Request(Client, MimeParser)

Method Index

 o canKeepConnection()
 o getClient()
Get the client of this request.
 o getClone()
Clone this request, in order to launch an internal request.
 o getInputStream()
Get this reply entity body.
 o getOriginal()
 o getQueryString()
 o getTargetResource()
Get this request target resource.
 o getURLPath()
 o hasAccept()
 o hasAcceptEncoding()
 o hasAcceptLanguage()
 o hasAuthorization()
 o hasContentLength()
 o hasContentType()
 o hasProxyAuthorization()
 o hasQueryString()
 o isInternal()
 o isProxy()
Is this request to be emited to a proxy ?
 o makeReply(int)
Make an empty Reply object matching this request version.
 o notifyEndParsing(MimeParser)
Fix the target URL of the request, this is the only good time to do so.
 o setInternal(boolean)
 o setProxy(boolean)
 o setTargetResource(HTTPResource)
 o setURLPath(String)
 o unescape(String)
Unescape a HTTP escaped string

Variables

 o THE_SERVER
  public static URL THE_SERVER
The URL that means * for an OPTIONS method.
 o client
  protected Client client
 o parser
  protected MimeParser parser
 o in
  protected InputStream in
 o keepcon
  protected boolean keepcon
 o internal
  protected boolean internal
 o original
  protected Request original

Constructors

 o Request
  public Request(Client client,
                 MimeParser parser)

Methods

 o notifyEndParsing
  public void notifyEndParsing(MimeParser parser) throws HttpParserException, IOException
Fix the target URL of the request, this is the only good time to do so.
Overrides:
notifyEndParsing in class HttpMessage
 o canKeepConnection
  public boolean canKeepConnection()
 o setTargetResource
  protected void setTargetResource(HTTPResource resource)
 o getTargetResource
  public HTTPResource getTargetResource()
Get this request target resource.
Returns:
An instance of HTTPResource, or null if not found.
 o setProxy
  public void setProxy(boolean onoff)
 o isProxy
  public boolean isProxy()
Is this request to be emited to a proxy ?
Overrides:
isProxy in class HttpRequestMessage
 o getURLPath
  public String getURLPath()
 o setURLPath
  public void setURLPath(String path)
 o hasContentLength
  public boolean hasContentLength()
 o hasContentType
  public boolean hasContentType()
 o hasAccept
  public boolean hasAccept()
 o hasAcceptEncoding
  public boolean hasAcceptEncoding()
 o hasAcceptLanguage
  public boolean hasAcceptLanguage()
 o hasAuthorization
  public boolean hasAuthorization()
 o hasProxyAuthorization
  public boolean hasProxyAuthorization()
 o getQueryString
  public String getQueryString()
 o hasQueryString
  public boolean hasQueryString()
 o isInternal
  public boolean isInternal()
 o setInternal
  public void setInternal(boolean onoff)
 o getOriginal
  public Request getOriginal()
 o getClone
  public HttpMessage getClone()
Clone this request, in order to launch an internal request. This method can be used to run a request in some given context, defined by an original request. It will preserve all the original information (such as authentication, etc), and will provide a clone of the original request.

The original request and its clone differ in the following way:

To run an internal request, the caller can then use the w3c.jigsaw.http.httpd perform method.

Returns:
A fresh Request instance, marked as internal.
Overrides:
getClone in class HttpMessage
 o getInputStream
  public InputStream getInputStream() throws IOException
Get this reply entity body. The reply entity body is returned as an InputStream, that the caller has to read to actually get the bytes of the content.
Returns:
An InputStream instance. If the reply has no body, the returned input stream will just return -1 on first read.
 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 makeReply
  public Reply makeReply(int status)
Make an empty Reply object matching this request version.
Parameters:
status - The status of the reply.
 o getClient
  public Client getClient()
Get the client of this request.

All Packages  Class Hierarchy  This Package  Previous  Next  Index