org.mortbay.http
public class HttpRequest extends HttpMessage
This class is not synchronized. It should be explicitly synchronized if it is used by multiple threads.
Version: $Id: HttpRequest.java,v 1.91 2006/11/23 08:56:52 gregwilkins Exp $
See Also: HttpResponse
| Field Summary | |
|---|---|
| static String | __CONNECT
Request METHODS. |
| static String | __DELETE
Request METHODS. |
| static String | __GET
Request METHODS. |
| static String | __HEAD
Request METHODS. |
| static int | __maxFormContentSize
Max size of the form content. |
| static int | __maxLineLength
Maximum header line length. |
| static StringMap | __methodCache |
| static String | __MOVE
Request METHODS. |
| static String | __OPTIONS
Request METHODS. |
| static String | __POST
Request METHODS. |
| static String | __PUT
Request METHODS. |
| static String | __TRACE
Request METHODS. |
| static StringMap | __versionCache |
| Constructor Summary | |
|---|---|
| HttpRequest()
Constructor. | |
| HttpRequest(HttpConnection connection)
Constructor.
| |
| Method Summary | |
|---|---|
| void | destroy()
Destroy the request. |
| List | getAcceptableTransferCodings()
Get the acceptable transfer encodings. |
| String | getAuthType() |
| String | getAuthUser() |
| Cookie[] | getCookies()
Extract received cookies from a header.
|
| String | getEncodedPath()
Get the encoded request path.
|
| String | getHost()
Get the request host.
|
| HttpResponse | getHttpResponse()
Get the HTTP Response. |
| String | getMethod()
Get the HTTP method for this request. |
| String | getParameter(String name)
Get a parameter value.
|
| Set | getParameterNames()
Get the set of parameter names.
|
| MultiMap | getParameters() |
| Map | getParameterStringArrayMap() |
| List | getParameterValues(String name)
Get multi valued paramater.
|
| String | getPath()
Get the request path.
|
| int | getPort()
Get the request port. |
| String | getQuery()
Get the request query.
|
| String | getRemoteAddr() |
| String | getRemoteHost() |
| String | getRequestLine()
Return the HTTP request line as it was received. |
| StringBuffer | getRequestURL()
Reconstructs the URL the client used to make the request. |
| HttpResponse | getResponse() |
| StringBuffer | getRootURL()
Reconstructs the URL the client used to make the request. |
| String | getScheme()
Get the request Scheme. |
| long | getTimeStamp()
Get Request TimeStamp
|
| String | getTimeStampStr()
Get Request TimeStamp
|
| URI | getURI()
Get the full URI.
|
| Principal | getUserPrincipal() |
| String | getVersion() |
| boolean | hasUserPrincipal() |
| boolean | isConfidential() |
| boolean | isHandled()
Is the request handled.
|
| boolean | isIntegral() |
| boolean | isUserInRole(String role) |
| void | readHeader(LineInput in)
Read the request line and header.
|
| void | setAuthType(String a) |
| void | setAuthUser(String user) |
| void | setHandled(boolean handled)
Set the handled status.
|
| void | setMethod(String method) |
| void | setPath(String path) |
| void | setQuery(String q) |
| void | setTimeStamp(long ts) |
| void | setUserPrincipal(Principal principal) |
| void | writeHeader(Writer writer)
Write the request header. |
| void | writeRequestLine(Writer writer)
Write the HTTP request line as it was received. |
Parameters: connection
Returns: List of codings.
Returns: Array of Cookies.
Returns: The path with % encoding.
Returns: The host name obtained from an absolute URI, the HTTP header field, the requests connection or the local host name.
Returns: associated response
Returns: The method
Parameters: name Parameter name
Returns: Parameter value
Returns: Set of parameter names.
Returns: Map of parameters
Returns: Parameters as a map of String arrays
Parameters: name Parameter name
Returns: Parameter values
Returns: The URI path of the request.
Returns: The port. 0 should be interpreted as the default port.
Returns: the request query excluding the '?'
Because this method returns a StringBuffer, not a string, you can modify the
URL easily, for example, to append query parameters.
This method is useful for creating redirect messages and for reporting errors.
Returns: a StringBuffer object containing the reconstructed URL
Deprecated: use getHttpResponse()
Because this method returns a StringBuffer, not a string, you can modify the
URL easily, for example, to append path and query parameters.
This method is useful for creating redirect messages and for reporting errors.
Returns: "scheme://host:port"
Returns: The request scheme (eg. "http", "https", etc.)
Returns: The time that the request was received.
Returns: The time that the request was received.
Returns: the request URI (not a clone).
Returns: True if this request came over an confidential channel such as SSL.
Returns: True if the request has been set to handled or the associated response is not editable.
Returns: True if this request came over an integral channel such as SSL
Parameters: in
Throws: IOException
Parameters: handled true or false
Parameters: writer Http output stream
Throws: IOException IO problem