|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.faceless.util.HttpRequestReader
public class HttpRequestReader
Represents an incoming HTTP Request, in a similar way to the javax.servlet.http.HttpServletRequest class. Currently just a thin wrapper on top of that class.
HttpRequestWriter| Constructor Summary | |
|---|---|
HttpRequestReader(javax.servlet.http.HttpServletRequest request)
|
|
| Method Summary | |
|---|---|
String |
getContentType()
Return the value of the Content-Type header |
javax.servlet.http.Cookie |
getCookie(String name)
Returns a cookie with the specified name. |
javax.servlet.http.Cookie[] |
getCookies()
Returns an array containing all of the Cookie objects the client sent with this request. |
long |
getDateHeader(String key)
Returns the value of the specified response header as a long value that represents a Date object. |
String |
getHeader(String key)
Returns the value of the specified response header as a String. |
Iterator |
getHeaderNames()
Returns an iterator of all the header names this response contains. |
Iterator |
getHeaders(String key)
Returns all the values of the specified response header as an Iterator of String objects. |
InputStream |
getInputStream()
Returns the body of the response as binary data using an InputStream. |
int |
getIntHeader(String key)
Returns the value of the specified response header as an int. |
String |
getMethod()
Get the status message returned from the response Returns the name of the HTTP method with which this request was made, for example, GET, POST, or PUT. |
String |
getPathInfo()
Returns any extra path information associated with the URL the client sent when it made this request. |
String |
getQueryString()
Returns the query string that is contained in the request URL after the path. |
BufferedReader |
getReader()
Returns the body of the response as character data using a BufferedReader. |
String |
getRemoteUser()
Returns the login of the user making this request, if the user has been authenticated, or null if the user has not been authenticated. |
javax.servlet.http.HttpServletRequest |
getUnderlyingRequest()
Returns the underlying HttpServletRequest this object is based on,
or null if the request is not based on an HttpServletRequest |
String |
getURI()
Get the URI that the request came for. |
String |
getURL()
Get the URL that the request came for. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public HttpRequestReader(javax.servlet.http.HttpServletRequest request)
| Method Detail |
|---|
public String getMethod()
public String getURL()
public String getURI()
public String getQueryString()
public String getPathInfo()
public javax.servlet.http.Cookie[] getCookies()
public javax.servlet.http.Cookie getCookie(String name)
public String getRemoteUser()
public Iterator getHeaders(String key)
Returns all the values of the specified response header as an Iterator of String objects.
Some headers, such as Accept-Language can be sent by clients as several headers each with a different value rather than sending the header as a comma separated list.
If the response did not include any headers of the specified name, this method returns an empty Iterator. The header name is case insensitive. You can use this method with any response header.
key - a String specifying the header name
public Iterator getHeaderNames()
public String getHeader(String key)
key - a String specifying the name of a response header
public int getIntHeader(String key)
throws NumberFormatException
Returns the value of the specified response header as an int. If the response does not have a header of the specified name, this method returns -1. If the header cannot be converted to an integer, this method throws a NumberFormatException.
The header name is case insensitive.
key - a String specifying the name of a response header
NumberFormatException - if the header value can't be converted to an intpublic long getDateHeader(String key)
Returns the value of the specified response header as a long value that represents a Date object. Use this method with headers that contain dates, such as Last-Modified.
The date is returned as the number of milliseconds since January 1, 1970 GMT. The header name is case insensitive.
If the response did not have a header of the specified name, this method returns -1. If the header can't be converted to a date, the method throws an IllegalArgumentException.
key - a String specifying the name of a response header
IllegalArgumentException - if the header can't be converted to a datepublic String getContentType()
public InputStream getInputStream()
throws IOException
getReader() may be called to read the body,
but not both.
IllegalStateException - if the getReader() method has already been called.
IOException
public BufferedReader getReader()
throws IOException
getInputStream() may be called to read the body, but not both.
IllegalStateException - if the getInputStream() method has already been called.
UnsupportedEncodingException - if the character encoding is not supported
IOExceptionpublic javax.servlet.http.HttpServletRequest getUnderlyingRequest()
HttpServletRequest this object is based on,
or null if the request is not based on an HttpServletRequest
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||