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.
-
client
-
-
filters
-
-
in
-
-
infilters
-
-
internal
-
-
keepcon
-
-
original
-
-
parser
-
-
THE_SERVER
- The URL that means * for an
OPTIONS
method.
-
Request(Client, MimeParser)
-
-
canKeepConnection()
-
-
getClient()
- Get the client of this request.
-
getClone()
- Clone this request, in order to launch an internal request.
-
getInputStream()
- Get this reply entity body.
-
getOriginal()
-
-
getQueryString()
-
-
getTargetResource()
- Get this request target resource.
-
getURLPath()
-
-
hasAccept()
-
-
hasAcceptEncoding()
-
-
hasAcceptLanguage()
-
-
hasAuthorization()
- Does this request has some specific authorization infos.
-
hasContentLength()
-
-
hasContentType()
-
-
hasProxyAuthorization()
-
-
hasQueryString()
-
-
isInternal()
-
-
isProxy()
-
-
makeReply(int)
- Make an empty Reply object matching this request version.
-
notifyEndParsing(MimeParser)
- Fix the target URL of the request, this is the only good time to do so.
-
setFilters(HTTPFilter[], int)
-
-
setInternal(boolean)
-
-
setProxy(boolean)
-
-
setTargetResource(HTTPResource)
-
-
setURLPath(String)
-
-
unescape(String)
- Unescape a HTTP escaped string
THE_SERVER
public static URL THE_SERVER
- The URL that means * for an
OPTIONS
method.
client
protected Client client
parser
protected MimeParser parser
in
protected InputStream in
keepcon
protected boolean keepcon
internal
protected boolean internal
original
protected Request original
filters
protected HTTPFilter filters[]
infilters
protected int infilters
Request
public Request(Client client,
MimeParser parser)
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
canKeepConnection
public boolean canKeepConnection()
setTargetResource
protected void setTargetResource(HTTPResource resource)
getTargetResource
public HTTPResource getTargetResource()
- Get this request target resource.
- Returns:
- An instance of HTTPResource, or null if
not found.
setProxy
public void setProxy(boolean onoff)
isProxy
public boolean isProxy()
getURLPath
public String getURLPath()
setURLPath
public void setURLPath(String path)
hasContentLength
public boolean hasContentLength()
hasContentType
public boolean hasContentType()
hasAccept
public boolean hasAccept()
hasAcceptEncoding
public boolean hasAcceptEncoding()
hasAcceptLanguage
public boolean hasAcceptLanguage()
hasAuthorization
public boolean hasAuthorization()
- Does this request has some specific authorization infos.
- Overrides:
- hasAuthorization in class HttpRequestMessage
hasProxyAuthorization
public boolean hasProxyAuthorization()
getQueryString
public String getQueryString()
hasQueryString
public boolean hasQueryString()
isInternal
public boolean isInternal()
setInternal
public void setInternal(boolean onoff)
getOriginal
public Request getOriginal()
setFilters
protected void setFilters(HTTPFilter filters[],
int infilters)
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:
- The clone is marked as internal, which can be tested
by the
isInternal
method.
- The clone will keep a pointer to the first request that was
cloned. This original request can be accessed by the
getOriginal
method.
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
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.
unescape
public static String unescape(String s)
- Unescape a HTTP escaped string
- Parameters:
- s - The string to be unescaped
- Returns:
- the unescaped string.
makeReply
public Reply makeReply(int status)
- Make an empty Reply object matching this request version.
- Parameters:
- status - The status of the reply.
getClient
public Client getClient()
- Get the client of this request.
All Packages Class Hierarchy This Package Previous Next Index