public abstract class BaseWebRequest extends java.lang.Object implements WebRequest
GET_METHOD, POST_METHOD
Constructor and Description |
---|
BaseWebRequest()
Default constructor that requires that
setConfiguration(Configuration) be called before the methods
requiring a configuration object. |
BaseWebRequest(Configuration theConfiguration) |
Modifier and Type | Method and Description |
---|---|
void |
addCookie(Cookie theCookie)
Adds a cookie to the request.
|
void |
addCookie(java.lang.String theName,
java.lang.String theValue)
Adds a cookie to the request.
|
void |
addCookie(java.lang.String theDomain,
java.lang.String theName,
java.lang.String theValue)
Adds a cookie to the request.
|
void |
addHeader(java.lang.String theName,
java.lang.String theValue)
Adds a header to the request.
|
void |
addParameter(java.lang.String theName,
java.lang.String theValue)
Adds a parameter to the request.
|
void |
addParameter(java.lang.String theName,
java.lang.String theValue,
java.lang.String theMethod)
Adds a parameter to the request.
|
Authentication |
getAuthentication() |
protected Configuration |
getConfiguration() |
java.lang.String |
getContentType() |
java.util.Vector |
getCookies() |
java.lang.String |
getHeader(java.lang.String theName)
Returns the first value corresponding to this header's name.
|
java.util.Enumeration |
getHeaderNames() |
java.lang.String[] |
getHeaderValues(java.lang.String theName)
Returns all the values associated with this header's name.
|
java.lang.String |
getParameterGet(java.lang.String theName)
Returns the first value corresponding to this parameter's name (provided
this parameter is passed in the URL).
|
java.util.Enumeration |
getParameterNamesGet() |
java.util.Enumeration |
getParameterNamesPost() |
java.lang.String |
getParameterPost(java.lang.String theName)
Returns the first value corresponding to this parameter's name (provided
this parameter is passed in the request body - POST).
|
java.lang.String[] |
getParameterValuesGet(java.lang.String theName)
Returns all the values corresponding to this parameter's name (provided
this parameter is passed in the URL).
|
java.lang.String[] |
getParameterValuesPost(java.lang.String theName)
Returns all the values corresponding to this parameter's name (provided
this parameter is passed in the request body - POST).
|
java.io.InputStream |
getUserData() |
void |
setAuthentication(Authentication theAuthentication)
Sets the authentication object that will configure the http request
|
void |
setConfiguration(Configuration theConfiguration) |
void |
setContentType(java.lang.String theContentType)
Sets the content type that will be set in the http request
|
void |
setUserData(java.io.InputStream theDataStream)
Allow the user to send arbitrary data in the request body
|
java.lang.String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getAutomaticSession, getRedirectorName, getSessionCookie, getURL, setAutomaticSession, setRedirectorName, setURL
public BaseWebRequest()
setConfiguration(Configuration)
be called before the methods
requiring a configuration object.public BaseWebRequest(Configuration theConfiguration)
theConfiguration
- the Cactus configurationprotected Configuration getConfiguration()
public void setConfiguration(Configuration theConfiguration)
theConfiguration
- the cactus configuration to assign to this
requestpublic void setContentType(java.lang.String theContentType)
WebRequest
setContentType
in interface WebRequest
theContentType
- the content typeWebRequest.setContentType(String)
public java.lang.String getContentType()
getContentType
in interface WebRequest
WebRequest.getContentType()
public void setUserData(java.io.InputStream theDataStream)
WebRequest
setUserData
in interface WebRequest
theDataStream
- the stream on which the data are put by the userWebRequest.setUserData(InputStream)
public java.io.InputStream getUserData()
getUserData
in interface WebRequest
WebRequest.getUserData()
public void addParameter(java.lang.String theName, java.lang.String theValue, java.lang.String theMethod)
WebRequest
HttpServletRequest
).addParameter
in interface WebRequest
theName
- the parameter's nametheValue
- the parameter's valuetheMethod
- GET_METHOD or POST_METHOD. If GET_METHOD then the
parameter will be sent in the query string of the URL. If
POST_METHOD, it will be sent as a parameter in the request body.WebRequest.addParameter(String, String, String)
public void addParameter(java.lang.String theName, java.lang.String theValue)
WebRequest
addParameter
in interface WebRequest
theName
- the parameter's nametheValue
- the parameter's valueWebRequest.addParameter(String, String)
public java.util.Enumeration getParameterNamesPost()
getParameterNamesPost
in interface WebRequest
WebRequest.getParameterNamesPost()
public java.util.Enumeration getParameterNamesGet()
getParameterNamesGet
in interface WebRequest
WebRequest.getParameterNamesGet()
public java.lang.String getParameterGet(java.lang.String theName)
WebRequest
getParameterGet
in interface WebRequest
theName
- the parameter's nameWebRequest.getParameterGet(String)
public java.lang.String getParameterPost(java.lang.String theName)
WebRequest
getParameterPost
in interface WebRequest
theName
- the parameter's nameWebRequest.getParameterPost(String)
public java.lang.String[] getParameterValuesGet(java.lang.String theName)
WebRequest
getParameterValuesGet
in interface WebRequest
theName
- the parameter's nameWebRequest.getParameterValuesGet(String)
public java.lang.String[] getParameterValuesPost(java.lang.String theName)
WebRequest
getParameterValuesPost
in interface WebRequest
theName
- the parameter's nameWebRequest.getParameterValuesPost(String)
public void addCookie(java.lang.String theName, java.lang.String theValue)
WebRequest
WebRequest.addCookie(String, String, String)
method or the method
WebRequest.addCookie(Cookie)
.addCookie
in interface WebRequest
theName
- the cookie's nametheValue
- the cookie's valueWebRequest.addCookie(String, String)
public void addCookie(java.lang.String theDomain, java.lang.String theName, java.lang.String theValue)
WebRequest
cactus.properties
) or the host set
using setURL()
.addCookie
in interface WebRequest
theDomain
- the cookie domaintheName
- the cookie nametheValue
- the cookie valueWebRequest.addCookie(String, String, String)
public void addCookie(Cookie theCookie)
WebRequest
cactus.properties
) or the host set
using setURL()
.addCookie
in interface WebRequest
theCookie
- the cookie to addWebRequest.addCookie(Cookie)
public java.util.Vector getCookies()
getCookies
in interface WebRequest
Cookie
objects)WebRequest.getCookies()
public void addHeader(java.lang.String theName, java.lang.String theValue)
WebRequest
addHeader
in interface WebRequest
theName
- the header's nametheValue
- the header's valueWebRequest.addHeader(String, String)
public java.util.Enumeration getHeaderNames()
getHeaderNames
in interface WebRequest
WebRequest.getHeaderNames()
public java.lang.String getHeader(java.lang.String theName)
WebRequest
getHeader
in interface WebRequest
theName
- the header's nameWebRequest.getHeader(String)
public java.lang.String[] getHeaderValues(java.lang.String theName)
WebRequest
getHeaderValues
in interface WebRequest
theName
- the header's nameWebRequest.getHeaderValues(String)
public java.lang.String toString()
toString
in class java.lang.Object
public void setAuthentication(Authentication theAuthentication)
WebRequest
setAuthentication
in interface WebRequest
theAuthentication
- the authentication objectWebRequest.setAuthentication(Authentication)
public Authentication getAuthentication()
getAuthentication
in interface WebRequest
WebRequest.getAuthentication()
Copyright © 2000-2004 Apache Software Foundation. All Rights Reserved.