|
Femto Web Server V1.4-F | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--java.util.Dictionary
|
+--java.util.Hashtable
|
+--dfischer.femtowebserver.httpd.HttpRequest
Allows Weblets and SSSIs to access the HTTP request data (browser request) and (optionally) allows a Filter to modify every HTTP request.
More information about the HTTP protocol is available at http://www.w3.org
HttpdWebletInterface,
HttpdSssiInterface,
HttpUploadFile,
HttpdFilter,
HttpdSession, Serialized Form| Inner classes inherited from class java.util.Map |
java.util.Map.Entry |
| Method Summary | |
void |
addCookie(java.lang.String name,
java.lang.String value)
Allows to add a cookie to the HTTP request. |
void |
addHeaderField(java.lang.String headerFieldName,
java.lang.String headerFieldValue)
Allows to add additional HTTP header fields inside the HTTP request header. |
void |
addParameter(java.lang.String parameterName,
java.lang.String parameterValue)
Allows to add an additional parameter to the HTTP request. |
void |
clearContent()
Allows to remove the request content data. |
void |
dump()
Dumps the HTTP request header and the request content to the log output. |
java.lang.String |
getBasicAuthorizationPassword()
Returns the (basic) authorization password, which has been set by the agent (browser). |
java.lang.String |
getBasicAuthorizationUsername()
Returns the (basic) authorization username, which has been set by the agent (browser). |
byte[] |
getContent()
Returns the content data of the request. |
java.lang.String |
getContentSubtype()
Returns the MIME subtype of the request content data, if this information has been set by the agent (browser). |
java.lang.String |
getContentType()
Returns the MIME type of the request content data, if this information has been set by the agent (browser). |
java.lang.String |
getCookieValue(java.lang.String cookieName)
Returns the value of a received cookie, selected by its name. |
java.lang.String[] |
getHeader()
Returns the whole HTTP request header. |
java.lang.String |
getHeaderField(java.lang.String headerFieldName)
Returns the value of a header field name. |
java.lang.String[] |
getHeaderFieldNames()
Returns a list of all request header field names (header line 1..n-1). |
java.lang.String |
getHttpProtocol()
Returns the HTTP protocol version ("HTTP/1.0", "HTTP/1.1" ...) of the agent (browser). |
java.lang.String |
getMethod()
Returns the HTTP request method ("GET", "POST" ...). |
java.lang.String |
getParameter(java.lang.String parameterName)
Returns the value of a request parameter. |
java.lang.String |
getParameter(java.lang.String parameterName,
boolean asRawValue)
Returns the value of a request parameter. |
int |
getParameterAsInt(java.lang.String parameterName)
Returns the value of a request parameter as int number. |
long |
getParameterAsLong(java.lang.String parameterName)
Returns the value of a request parameter as long number. |
java.lang.String[] |
getParameterNames()
Returns a list of all names of the request parameters, nevertheless if there is a "GET" or a "POST" request. |
java.lang.String |
getParameterString(java.lang.String parameterName)
Returns the value of a request parameter or an empty string, if no such parameter is available. |
java.lang.String[] |
getParameterValues(java.lang.String parameterName)
Returns all values of one request parameter name. |
java.lang.String |
getProtocol()
Returns the request network protocol ("http", "https" ...). |
java.lang.String |
getQueryString()
Deprecated. Better use getParameterNames() and getParameter() |
HttpCookie[] |
getReceivedCookies()
Returns an array[] of all received cookies. |
java.lang.String |
getRemoteAddress()
Returns the TCP/IP remote address of the agent (browser). |
java.lang.String |
getRequest()
Returns the request file with the full path, but does not include the (optional) CGI parameters. |
java.lang.String |
getRequestFile()
Returns the request file without any path. |
java.lang.String |
getRequestPath()
Returns the path to the request file (without the request file itself). |
HttpdSession |
getSession()
Returns the current HTTP session (only if a session handler is active). |
HttpUploadFile |
getUploadFile(java.lang.String parameterName)
Returns an uploaded file with its data, selected by the HTML parameter name. |
HttpUploadFile[] |
getUploadFiles()
Returns all uploaded files. |
java.lang.String |
getURI()
Deprecated. Better use getRequest(), getParameterNames() and getParameter() |
java.lang.String |
getUserAgent()
Returns the browser product name and version (if any). |
java.lang.String |
getVirtualHost()
Returns the name of the TCP/IP host (server) to which the agent (browser) has made the request. |
int |
getVirtualPort()
Returns the non-standard server port number to which the agent (browser) has made the request. |
boolean |
hasBasicAuthorization()
Checks if a base64 (basic) authorization has been set by the agent (browser). |
void |
removeCookie(java.lang.String name)
Removes a received cookie from the HTTP request. |
void |
removeHeaderField(java.lang.String headerFieldName)
Removes a HTTP header field. |
void |
removeParameter(java.lang.String parameterName)
Removes a parameter from the HTTP request. |
void |
setContent(byte[] content)
Allows to change the request content data. |
void |
setContentSubtype(java.lang.String contentSubtype)
Allows to set a new MIME subtype of the request content data. |
void |
setContentType(java.lang.String contentType)
Allows to set a new MIME type of the request content data. |
void |
setMethod(java.lang.String method)
Allows to change the HTTP request method ("GET", "POST" ...). |
void |
setRemoteAddress(java.lang.String remoteAddress)
Allows to change the TCP/IP remote address of the agent (browser). |
void |
setRequest(java.lang.String requestFile)
Allows to set a new request file which must include also the full path, but without (optional) CGI parameters. |
void |
setSession(HttpdSession httpdSession)
Allows to set a HTTP session before the request will be processed by the Femto Web Server. |
void |
setUserAgent(java.lang.String userAgent)
Allows to set a new browser product name and version. |
void |
setVirtualHost(java.lang.String hostname)
Allows to set a new name of the TCP/IP host (server) to which the agent (browser) has made the request. |
void |
setVirtualPort(int port)
Allows to set a non-standard server port number to which the agent (browser) has made the request. |
void |
updateCookie(java.lang.String name,
java.lang.String value)
Allows to update the value of a cookie - or adds a new cookie if it doesn't exist. |
void |
updateCookieName(java.lang.String oldName,
java.lang.String newName)
Allows to modify the name of a received cookie. |
void |
updateHeaderField(java.lang.String headerFieldName,
java.lang.String headerFieldValue)
Allows to replace a HTTP header field value inside the HTTP request header. |
void |
updateParameter(java.lang.String parameterName,
java.lang.String parameterValue)
Allows to replace a parameter of the HTTP request. |
| Methods inherited from class java.util.Hashtable |
clear, clone, contains, containsKey, containsValue, elements, entrySet, equals, get, hashCode, isEmpty, keys, keySet, put, putAll, remove, size, toString, values |
| Methods inherited from class java.lang.Object |
getClass, notify, notifyAll, wait, wait, wait |
| Method Detail |
public void setSession(HttpdSession httpdSession)
httpdSession - the HTTP sessionHttpdFilter,
HttpSessionCookieHandlerpublic HttpdSession getSession()
HttpSessionCookieHandlerpublic java.lang.String getRemoteAddress()
public void setRemoteAddress(java.lang.String remoteAddress)
throws java.net.UnknownHostException
remoteAddress - the TCP/IP remote address of the agent (browser)HttpdFilterpublic java.lang.String[] getHeader()
getHeaderFieldNames(),
getHeaderField(java.lang.String)public java.lang.String[] getHeaderFieldNames()
getHeaderField(java.lang.String),
getHeader()public java.lang.String getHeaderField(java.lang.String headerFieldName)
headerFieldName - name of the header field (upper-/lower-case insensitive).getHeaderFieldNames(),
getHeader()
public void addHeaderField(java.lang.String headerFieldName,
java.lang.String headerFieldValue)
headerFieldName - the header field name to addheaderFieldValue - the value of the header fieldupdateHeaderField(java.lang.String, java.lang.String),
HttpdFilter
public void updateHeaderField(java.lang.String headerFieldName,
java.lang.String headerFieldValue)
headerFieldName - the header field name whose value should be modifiedheaderFieldValue - the new value of the header fieldaddHeaderField(java.lang.String, java.lang.String),
getHeaderField(java.lang.String),
HttpdFilterpublic void removeHeaderField(java.lang.String headerFieldName)
The field "content-length" can only be modified by the methods setContent() or clearContent() and can not be removed here.
headerFieldName - the name of the HTTP header field to remove. If the field name is not found
inside the HTTP request header, this method will also complete successful.HttpdFilterpublic HttpCookie[] getReceivedCookies()
getCookieValue(java.lang.String)public java.lang.String getCookieValue(java.lang.String cookieName)
cookieName - the name of the cookie (case sensitive)getReceivedCookies()
public void addCookie(java.lang.String name,
java.lang.String value)
name - cookie name (case sensitive)value - cookie valuegetCookieValue(java.lang.String),
updateCookie(java.lang.String, java.lang.String),
updateCookieName(java.lang.String, java.lang.String),
removeCookie(java.lang.String),
getReceivedCookies(),
HttpdFilter
public void updateCookie(java.lang.String name,
java.lang.String value)
name - the name of the cookie to modify or to add (case sensitive).value - the new cookie value.getCookieValue(java.lang.String),
addCookie(java.lang.String, java.lang.String),
updateCookieName(java.lang.String, java.lang.String),
removeCookie(java.lang.String),
getReceivedCookies(),
HttpdFilter
public void updateCookieName(java.lang.String oldName,
java.lang.String newName)
If no cookie with this name has been received, nothing will be done.
oldName - the (old) name of the cookie (case sensitive).newName - the new name of the cookie.getCookieValue(java.lang.String),
addCookie(java.lang.String, java.lang.String),
updateCookie(java.lang.String, java.lang.String),
removeCookie(java.lang.String),
getReceivedCookies(),
HttpdFilterpublic void removeCookie(java.lang.String name)
name - the name of the cookie to remove from the HTTP request (case sensitive).
if no cookie with this name has been received, nothing will be done.getCookieValue(java.lang.String),
addCookie(java.lang.String, java.lang.String),
updateCookie(java.lang.String, java.lang.String),
updateCookieName(java.lang.String, java.lang.String),
getReceivedCookies(),
HttpdFilterpublic java.lang.String getMethod()
public void setMethod(java.lang.String method)
method - the HTTP request method, will be converted to UPPERCASE.getMethod(),
HttpdFilterpublic java.lang.String getURI()
getRequest(),
getParameterNames(),
getParameter(java.lang.String)public java.lang.String getProtocol()
public java.lang.String getHttpProtocol()
public java.lang.String getUserAgent()
public void setUserAgent(java.lang.String userAgent)
Updates also the HTTP header.
userAgent - the new browser product name and versiongetUserAgent(),
HttpdFilterpublic java.lang.String getVirtualHost()
getVirtualPort(),
HttpdProperties.getServerName()public void setVirtualHost(java.lang.String hostname)
Updates also the HTTP header.
hostname - the new name of the TCP/IP host (server) to which the agent (browser) has made the request.getVirtualHost(),
setVirtualPort(int),
HttpdFilterpublic int getVirtualPort()
getVirtualHost(),
HttpdProperties.getServerPort()public void setVirtualPort(int port)
port - the non-standard TCP/IP port numbergetVirtualPort(),
setVirtualHost(java.lang.String),
HttpdFilterpublic java.lang.String getContentType()
getContentSubtype(),
getContent()public void setContentType(java.lang.String contentType)
Updates also the HTTP header.
contentType - the new MIME type of the request content datasetContentSubtype(java.lang.String),
HttpdFilterpublic java.lang.String getContentSubtype()
getContentType()public void setContentSubtype(java.lang.String contentSubtype)
Updates also the HTTP header.
contentSubtype - the new MIME subtype of the request content data. By passing null as
argument value, the subtype will be deleted.setContentType(java.lang.String),
HttpdFilterpublic byte[] getContent()
getParameterNames(),
getParameter(java.lang.String)public void setContent(byte[] content)
This also changeds the "Content-Length" field inside the HTTP request header to the new, correct value. Additionaly all GET and POST parameters are first deleted and afterwards recalculated, based on the new content: this means also all GET CGI-Parameters are lost.
content - the new content dataHttpdFilterpublic void clearContent()
The "Content-Length" field inside the HTTP request header will also be removed and all GET and POST parameters are deleted.
HttpdFilterpublic java.lang.String getQueryString()
getParameterNames(),
getParameter(java.lang.String)public java.lang.String getRequestPath()
getRequestFile(),
getRequest()public java.lang.String getRequestFile()
getRequestPath(),
getRequest()public java.lang.String getRequest()
getRequestPath(),
getRequestFile()public void setRequest(java.lang.String requestFile)
This method automatically changes also the results of getRequestPath() and getRequestFile().
requestFile - the new request file with its full path.getRequest(),
getRequestPath(),
getRequestFile(),
HttpdFilterpublic java.lang.String[] getParameterNames()
getParameter(String),
getParameter(String, boolean),
getParameterString(java.lang.String),
getParameterAsInt(java.lang.String)public java.lang.String[] getParameterValues(java.lang.String parameterName)
parameterName - the name of the request parameter (case insensitive)public java.lang.String getParameter(java.lang.String parameterName)
parameterName - the name of the request parameter (case insensitive)getParameter(String, boolean),
getParameterString(java.lang.String),
getParameterAsInt(java.lang.String),
getParameterNames()
public java.lang.String getParameter(java.lang.String parameterName,
boolean asRawValue)
parameterName - the name of the request parameter (case insensitive)asRawValue - if true, don't decode the value from the MIME "x-www-form-urlencoded" formatgetParameter(String),
getParameterString(java.lang.String),
getParameterAsInt(java.lang.String),
getParameterNames()public java.lang.String getParameterString(java.lang.String parameterName)
parameterName - the name of the request parameter (case insensitive)getParameter(String),
getParameter(String, boolean),
getParameterAsInt(java.lang.String),
getParameterNames()public int getParameterAsInt(java.lang.String parameterName)
parameterName - the name of the request parameter (case insensitive)getParameterAsLong(java.lang.String),
getParameter(String),
getParameter(String, boolean),
getParameterString(java.lang.String),
getParameterNames()public long getParameterAsLong(java.lang.String parameterName)
parameterName - the name of the request parameter (case insensitive)getParameterAsInt(java.lang.String),
getParameter(String),
getParameter(String, boolean),
getParameterString(java.lang.String),
getParameterNames()
public void addParameter(java.lang.String parameterName,
java.lang.String parameterValue)
Does not update the content data and doesn't correct the CGI parameters delivered by the deprecated methods getQueryString() and getURI().
parameterName - the new parameter name to addparameterValue - the new parameter value to addsetContent(byte[]),
HttpdFilter
public void updateParameter(java.lang.String parameterName,
java.lang.String parameterValue)
If the parameter does not alreay exist, it will be added by calling addParameter() Does not update the content data and doesn't correct the CGI parameters delivered by the deprecated methods getQueryString() and getURI().
parameterName - the parameter name whose value should be modified (case insensitive)parameterValue - the new value of the parametersetContent(byte[]),
HttpdFilterpublic void removeParameter(java.lang.String parameterName)
If the parameter name was not found, this method still completes sucessful. Does not modify the content data and doesn't correct the CGI parameters delivered by the deprecated methods getQueryString() and getURI().
parameterName - the parameter name to remove (case insensitive)setContent(byte[]),
HttpdFilterpublic HttpUploadFile getUploadFile(java.lang.String parameterName)
parameterName - HTML parameter namegetUploadFiles()public HttpUploadFile[] getUploadFiles()
getUploadFile(java.lang.String)public boolean hasBasicAuthorization()
getBasicAuthorizationUsername(),
getBasicAuthorizationPassword()public java.lang.String getBasicAuthorizationUsername()
getBasicAuthorizationPassword(),
hasBasicAuthorization()public java.lang.String getBasicAuthorizationPassword()
getBasicAuthorizationUsername(),
hasBasicAuthorization()public void dump()
Httpd.setLogStream(java.io.PrintStream)
|
Femto Web Server V1.4-F | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||