|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--webcore.webserver.HTTPRequest
Class to hold the HTTPRequest from the browser.
An instance of this class is passed to WebRequestables to handle the request. There are methods to get the form variables and output stream from the request.
Field Summary | |
static java.lang.String |
HD_CONTENT_LEN
|
static java.lang.String |
HD_CONTENT_TYPE
|
static java.lang.String |
HD_COOKIE
|
static java.lang.String |
HD_HOST
|
static java.lang.String |
HD_METHOD_GET
|
static java.lang.String |
HD_METHOD_POST
|
static java.lang.String |
HD_MULTIPART_BOUNDARY
|
static java.lang.String |
HD_MULTIPART_CONTENT
|
static java.lang.String |
HD_USERAGENT
|
static long |
MAX_CONTENT_LENGTH
|
Constructor Summary | |
HTTPRequest(java.net.Socket requestSocket,
java.lang.String requestStr,
java.lang.String docBase)
constructs a new HTTPRequest after the request HTTP header has been read from the stream. |
Method Summary | |
void |
close()
flushes output streams and closes the socket |
java.lang.String |
getCookie(java.lang.String cookieName)
returns the value of a cookie. |
java.lang.String[] |
getCookieNames()
Returns an array containing all the available cookie names provided by the request |
java.lang.String |
getDocBase()
returns the document base, which is passed to the request from the webserver |
java.lang.String |
getFormVar(java.lang.String formVariable)
returns the string value of a form variable, if the variable is not found, null is returned If the content type is multipart/form-data, the variables must be read manually. |
java.lang.String[] |
getFormVariableNames()
returns all the form variables If the content type is multipart/form-data, the variables must be read manually. |
java.lang.String |
getHost()
returns the host passed in the HTTP header |
java.io.InputStream |
getInputStream()
returns the InputStream to write to for this request |
java.lang.String |
getMethod()
returns the method in the HTTP header (GET or POST are supported) |
java.io.OutputStream |
getOutputStream()
returns the OutputStream to write to for this request |
java.io.PrintWriter |
getPrintWriter()
returns a PrintWriter to write to the output stream for this request. |
java.lang.String |
getRequestedFile()
returns the URI with the slashes converted to the local filesystem |
java.lang.String |
getRequestedObject()
returns the URI |
java.lang.String |
getRequestedPath()
returns full path to the requested file based on the document base |
java.net.Socket |
getRequestSocket()
|
boolean |
isProcessed()
determine if the request has been process or not |
void |
setProcessed(boolean value)
if an event listener to the WebServer processes the request, it should set the httpRequests processed property to TRUE using this method |
java.lang.String |
toString()
returns the request object string |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final java.lang.String HD_METHOD_GET
public static final java.lang.String HD_METHOD_POST
public static final java.lang.String HD_COOKIE
public static final java.lang.String HD_CONTENT_LEN
public static final java.lang.String HD_CONTENT_TYPE
public static final java.lang.String HD_HOST
public static final java.lang.String HD_USERAGENT
public static final java.lang.String HD_MULTIPART_CONTENT
public static final java.lang.String HD_MULTIPART_BOUNDARY
public static final long MAX_CONTENT_LENGTH
Constructor Detail |
public HTTPRequest(java.net.Socket requestSocket, java.lang.String requestStr, java.lang.String docBase) throws java.io.IOException
Post data has not been read yet.
Method Detail |
public java.net.Socket getRequestSocket()
public java.io.PrintWriter getPrintWriter() throws java.io.IOException
java.io.IOException
public java.io.OutputStream getOutputStream() throws java.io.IOException
java.io.IOException
public java.io.InputStream getInputStream() throws java.io.IOException
java.io.IOException
public void close() throws java.io.IOException
java.io.IOException
public java.lang.String getDocBase()
public java.lang.String getRequestedObject()
public java.lang.String getRequestedFile()
public java.lang.String getRequestedPath()
public java.lang.String getHost()
public java.lang.String getMethod()
public java.lang.String[] getFormVariableNames()
If the content type is multipart/form-data, the variables must be read manually.
public java.lang.String getFormVar(java.lang.String formVariable)
If the content type is multipart/form-data, the variables must be read manually.
public java.lang.String[] getCookieNames()
public java.lang.String getCookie(java.lang.String cookieName)
public java.lang.String toString()
toString
in class java.lang.Object
public boolean isProcessed()
public void setProcessed(boolean value)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |