HDIV API 2.0.4

org.hdiv.filter
Class RequestWrapper

java.lang.Object
  extended by javax.servlet.ServletRequestWrapper
      extended by javax.servlet.http.HttpServletRequestWrapper
          extended by org.hdiv.filter.RequestWrapper
All Implemented Interfaces:
javax.servlet.http.HttpServletRequest, javax.servlet.ServletRequest

public class RequestWrapper
extends javax.servlet.http.HttpServletRequestWrapper

A wrapper for HTTP servlet request.

Author:
Roberto Velasco, Gorka Vicente
See Also:
HttpServletRequestWrapper

Field Summary
 
Fields inherited from interface javax.servlet.http.HttpServletRequest
BASIC_AUTH, CLIENT_CERT_AUTH, DIGEST_AUTH, FORM_AUTH
 
Constructor Summary
RequestWrapper(javax.servlet.http.HttpServletRequest servletRequest)
          Constructs a request object wrapping the given request.
 
Method Summary
 void addFileItem(java.lang.String name, java.util.List values)
          Adds a file parameter to the set of file parameters for this request.
 void addFileItem(java.lang.String name, org.springframework.web.multipart.MultipartFile value)
          Adds a file parameter to the set of file parameters for this request.
 void addParameter(java.lang.String name, java.lang.Object value)
          Add a single value for the specified HTTP parameter name.
 void addTextParameter(java.lang.String name, java.lang.Object value)
          Adds a regular text parameter to the set of text parameters for this request.
 java.util.Hashtable getFileElements()
          Returns a hash table containing the file (that is, non-text) request parameters.
 java.lang.String getHeader(java.lang.String name)
          Returns the value of the specified request header as a String.
 java.util.Enumeration getHeaders(java.lang.String name)
          Returns all the values of the specified request header as an Enumeration of String objects.
 java.lang.String getParameter(java.lang.String parameter)
          Returns the value of a request parameter as a String.
 java.util.Map getParameterMap()
          Combines the parameters stored here with those in the underlying request.
 java.util.Enumeration getParameterNames()
          Returns the names of the parameters for this request.
 java.lang.String[] getParameterValues(java.lang.String parameter)
          Returns an array of String objects containing all of the values the given request parameter has.
 java.util.Hashtable getTextElements()
          Returns a hash table containing the text (that is, non-file) request parameters.
 void setConfidentiality(java.lang.Boolean confidentiality)
           
 void setCookiesConfidentiality(boolean cookiesConfidentiality)
           
 void setMultipart(boolean isMultipart)
          Determines whether this request is multipart.
 
Methods inherited from class javax.servlet.http.HttpServletRequestWrapper
getAuthType, getContextPath, getCookies, getDateHeader, getHeaderNames, getIntHeader, getMethod, getPathInfo, getPathTranslated, getQueryString, getRemoteUser, getRequestedSessionId, getRequestURI, getRequestURL, getServletPath, getSession, getSession, getUserPrincipal, isRequestedSessionIdFromCookie, isRequestedSessionIdFromUrl, isRequestedSessionIdFromURL, isRequestedSessionIdValid, isUserInRole
 
Methods inherited from class javax.servlet.ServletRequestWrapper
getAttribute, getAttributeNames, getCharacterEncoding, getContentLength, getContentType, getInputStream, getLocalAddr, getLocale, getLocales, getLocalName, getLocalPort, getProtocol, getReader, getRealPath, getRemoteAddr, getRemoteHost, getRemotePort, getRequest, getRequestDispatcher, getScheme, getServerName, getServerPort, isSecure, removeAttribute, setAttribute, setCharacterEncoding, setRequest
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.servlet.ServletRequest
getAttribute, getAttributeNames, getCharacterEncoding, getContentLength, getContentType, getInputStream, getLocalAddr, getLocale, getLocales, getLocalName, getLocalPort, getProtocol, getReader, getRealPath, getRemoteAddr, getRemoteHost, getRemotePort, getRequestDispatcher, getScheme, getServerName, getServerPort, isSecure, removeAttribute, setAttribute, setCharacterEncoding
 

Constructor Detail

RequestWrapper

public RequestWrapper(javax.servlet.http.HttpServletRequest servletRequest)
Constructs a request object wrapping the given request.

Parameters:
servletRequest - request
Method Detail

getParameterValues

public java.lang.String[] getParameterValues(java.lang.String parameter)
Returns an array of String objects containing all of the values the given request parameter has. If the parameter has a single value, the array has a length of 1.

Specified by:
getParameterValues in interface javax.servlet.ServletRequest
Overrides:
getParameterValues in class javax.servlet.ServletRequestWrapper
Parameters:
parameter - the name of the parameter whose value is requested

getParameter

public java.lang.String getParameter(java.lang.String parameter)
Returns the value of a request parameter as a String. Request parameters are extra information sent with the request. For HTTP servlets, parameters are contained in the query string or posted form data.

Specified by:
getParameter in interface javax.servlet.ServletRequest
Overrides:
getParameter in class javax.servlet.ServletRequestWrapper
Parameters:
parameter - name of the parameter

getParameterNames

public java.util.Enumeration getParameterNames()
Returns the names of the parameters for this request. The enumeration consists of the normal request parameter names plus the parameters read from the multipart request.

Specified by:
getParameterNames in interface javax.servlet.ServletRequest
Overrides:
getParameterNames in class javax.servlet.ServletRequestWrapper

getHeader

public java.lang.String getHeader(java.lang.String name)
Returns the value of the specified request header as a String.

Specified by:
getHeader in interface javax.servlet.http.HttpServletRequest
Overrides:
getHeader in class javax.servlet.http.HttpServletRequestWrapper
Parameters:
name - header name
Returns:
a String containing the value of the requested header, or null if the request does not have a header of that name
Since:
HDIV 1.1.1

getHeaders

public java.util.Enumeration getHeaders(java.lang.String name)
Returns all the values of the specified request header as an Enumeration of String objects.

Specified by:
getHeaders in interface javax.servlet.http.HttpServletRequest
Overrides:
getHeaders in class javax.servlet.http.HttpServletRequestWrapper
Parameters:
name - a String specifying the header name
Returns:
an Enumeration containing the values of the requested header. If the request does not have any headers of that name return an empty enumeration. If the container does not allow access to header information, return null.
Since:
HDIV 1.1.1

addParameter

public void addParameter(java.lang.String name,
                         java.lang.Object value)
Add a single value for the specified HTTP parameter name.

Parameters:
name - parameter name
value - value

getParameterMap

public java.util.Map getParameterMap()
Combines the parameters stored here with those in the underlying request. If paramater values in the underlying request take precedence over those stored here.

Specified by:
getParameterMap in interface javax.servlet.ServletRequest
Overrides:
getParameterMap in class javax.servlet.ServletRequestWrapper
Since:
HDIV 1.3

getTextElements

public java.util.Hashtable getTextElements()
Returns a hash table containing the text (that is, non-file) request parameters.

Returns:
The text request parameters.

getFileElements

public java.util.Hashtable getFileElements()
Returns a hash table containing the file (that is, non-text) request parameters.

Returns:
The file request parameters.

addTextParameter

public void addTextParameter(java.lang.String name,
                             java.lang.Object value)
Adds a regular text parameter to the set of text parameters for this request.

Parameters:
name - text parameter name
value - text parameter value

addFileItem

public void addFileItem(java.lang.String name,
                        org.springframework.web.multipart.MultipartFile value)
Adds a file parameter to the set of file parameters for this request.

Parameters:
name -
values -

addFileItem

public void addFileItem(java.lang.String name,
                        java.util.List values)
Adds a file parameter to the set of file parameters for this request.

Parameters:
name -
values -

setMultipart

public void setMultipart(boolean isMultipart)
Determines whether this request is multipart.

Parameters:
isMultipart -

setCookiesConfidentiality

public void setCookiesConfidentiality(boolean cookiesConfidentiality)
Parameters:
cookiesConfidentiality - The cookiesConfidentiality to set.

setConfidentiality

public void setConfidentiality(java.lang.Boolean confidentiality)
Parameters:
confidentiality - The confidentiality to set.

HDIV 2.0.4

Copyright © 2008 hdiv.org. All Rights Reserved.