## org.exist.http.servlets
Class HttpRequestWrapper

    java.lang.Object
      org.exist.http.servlets.HttpRequestWrapper

All Implemented Interfaces:
  RequestWrapper

public class HttpRequestWrapper
extends java.lang.Object
implements RequestWrapper

A wrapper for requests processed by a servlet.

Author:
  Wolfgang Meier <wolfgang@exist-db.org>, Pierrick Brihaye <pierrick.brihaye@free.fr>

Constructor Summary
`HttpRequestWrapper(javax.servlet.http.HttpServletRequest servletRequest, java.lang.String formEncoding, java.lang.String containerEncoding)` Constructs a wrapper for the given servlet request.

Method Summary
`java.lang.String` `getCharacterEncoding()`
`int` `getContentLength()`
`java.lang.String` `getContentType()`
`java.lang.String` `getContextPath()`
`javax.servlet.http.Cookie[]` `getCookies()` Returns an array of Cookies
`java.io.File` `getFileUploadParam(java.lang.String name)`
`java.lang.String` `getHeader(java.lang.String arg0)`
`java.util.Enumeration` `getHeaderNames()`
`java.util.Enumeration` `getHeaders(java.lang.String arg0)`
`java.io.InputStream` `getInputStream()`
`java.lang.String` `getMethod()`
`java.lang.String` `getParameter(java.lang.String name)`
`java.util.Enumeration` `getParameterNames()`
`java.lang.String[]` `getParameterValues(java.lang.String key)`
`java.lang.String` `getPathInfo()`
`java.lang.String` `getPathTranslated()`
`java.lang.String` `getProtocol()`
`java.lang.String` `getQueryString()`
`java.lang.String` `getRemoteAddr()`
`java.lang.String` `getRemoteHost()`
`java.lang.String` `getRemoteUser()`
`java.lang.String` `getRequestedSessionId()`
`java.lang.String` `getRequestURI()`
`java.lang.StringBuffer` `getRequestURL()`
`java.lang.String` `getScheme()`
`java.lang.String` `getServerName()`
`int` `getServerPort()`
`java.lang.String` `getServletPath()`
`SessionWrapper` `getSession()`
`SessionWrapper` `getSession(boolean arg0)`
`java.lang.String` `getUploadedFileName(java.lang.String name)`
`java.security.Principal` `getUserPrincipal()`
`boolean` `isRequestedSessionIdFromCookie()`
`boolean` `isRequestedSessionIdFromURL()`
`boolean` `isRequestedSessionIdValid()`
`boolean` `isSecure()`
`boolean` `isUserInRole(java.lang.String arg0)`
`void` `removeAttribute(java.lang.String arg0)`
`void` `setAttribute(java.lang.String arg0, java.lang.Object arg1)`
`void` `setCharacterEncoding(java.lang.String arg0)`

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### HttpRequestWrapper

    public HttpRequestWrapper(javax.servlet.http.HttpServletRequest servletRequest,
                              java.lang.String formEncoding,
                              java.lang.String containerEncoding)

  Constructs a wrapper for the given servlet request.

Parameters:
  `servletRequest` - The request as viewed by the servlet
  `formEncoding` - The encoding of the request's forms
  `containerEncoding` - The encoding of the servlet

Method Detail

### getCookies

    public javax.servlet.http.Cookie[] getCookies()

  Returns an array of Cookies

  Specified by:
    `getCookies` in interface `RequestWrapper`

### getInputStream

    public java.io.InputStream getInputStream()
                                       throws java.io.IOException

  Specified by:
    `getInputStream` in interface `RequestWrapper`
  Throws:
    `java.io.IOException`
  See Also:
    `ServletRequest.getInputStream()`

### getCharacterEncoding

    public java.lang.String getCharacterEncoding()

  Specified by:
    `getCharacterEncoding` in interface `RequestWrapper`
  See Also:
    `ServletRequest.getCharacterEncoding()`

### getContentLength

    public int getContentLength()

  Specified by:
    `getContentLength` in interface `RequestWrapper`
  See Also:
    `ServletRequest.getContentLength()`

### getContentType

    public java.lang.String getContentType()

  Specified by:
    `getContentType` in interface `RequestWrapper`
  See Also:
    `ServletRequest.getContentType()`

### getContextPath

    public java.lang.String getContextPath()

  Specified by:
    `getContextPath` in interface `RequestWrapper`
  See Also:
    `HttpServletRequest.getContextPath()`

### getHeader

    public java.lang.String getHeader(java.lang.String arg0)

  Specified by:
    `getHeader` in interface `RequestWrapper`
  See Also:
    `HttpServletRequest.getHeader(String)`

### getHeaderNames

    public java.util.Enumeration getHeaderNames()

  Specified by:
    `getHeaderNames` in interface `RequestWrapper`
  Returns:
    An enumeration of header names
  See Also:
    `ServletRequest.getCharacterEncoding()`

### getHeaders

    public java.util.Enumeration getHeaders(java.lang.String arg0)

  Specified by:
    `getHeaders` in interface `RequestWrapper`
  See Also:
    `HttpServletRequest.getHeaders(String)`

### getMethod

    public java.lang.String getMethod()

  Specified by:
    `getMethod` in interface `RequestWrapper`
  See Also:
    `HttpServletRequest.getMethod()`

### getParameter

    public java.lang.String getParameter(java.lang.String name)

  Specified by:
    `getParameter` in interface `RequestWrapper`
  See Also:
    `ServletRequest.getParameter(String)`

### getFileUploadParam

    public java.io.File getFileUploadParam(java.lang.String name)

  Specified by:
    `getFileUploadParam` in interface `RequestWrapper`
  See Also:
    `ServletRequest.getParameter(String)`

### getUploadedFileName

    public java.lang.String getUploadedFileName(java.lang.String name)

  Specified by:
    `getUploadedFileName` in interface `RequestWrapper`
  See Also:
    `ServletRequest.getParameter(String)`

### getParameterNames

    public java.util.Enumeration getParameterNames()

  Specified by:
    `getParameterNames` in interface `RequestWrapper`
  See Also:
    `ServletRequest.getParameterNames()`

### getParameterValues

    public java.lang.String[] getParameterValues(java.lang.String key)

  Specified by:
    `getParameterValues` in interface `RequestWrapper`
  See Also:
    `ServletRequest.getParameterValues(String)`

### getPathInfo

    public java.lang.String getPathInfo()

  Specified by:
    `getPathInfo` in interface `RequestWrapper`
  See Also:
    `HttpServletRequest.getPathInfo()`

### getPathTranslated

    public java.lang.String getPathTranslated()

  Specified by:
    `getPathTranslated` in interface `RequestWrapper`
  See Also:
    `HttpServletRequest.getPathTranslated()`

### getProtocol

    public java.lang.String getProtocol()

  Specified by:
    `getProtocol` in interface `RequestWrapper`
  See Also:
    `ServletRequest.getProtocol()`

### getQueryString

    public java.lang.String getQueryString()

  Specified by:
    `getQueryString` in interface `RequestWrapper`
  See Also:
    `HttpServletRequest.getQueryString()`

### getRemoteAddr

    public java.lang.String getRemoteAddr()

  Specified by:
    `getRemoteAddr` in interface `RequestWrapper`
  See Also:
    `ServletRequest.getRemoteAddr()`

### getRemoteHost

    public java.lang.String getRemoteHost()

  Specified by:
    `getRemoteHost` in interface `RequestWrapper`
  See Also:
    `ServletRequest.getRemoteHost()`

### getRemoteUser

    public java.lang.String getRemoteUser()

  Specified by:
    `getRemoteUser` in interface `RequestWrapper`
  See Also:
    `HttpServletRequest.getRemoteUser()`

### getRequestedSessionId

    public java.lang.String getRequestedSessionId()

  Specified by:
    `getRequestedSessionId` in interface `RequestWrapper`
  See Also:
    `HttpServletRequest.getRequestedSessionId()`

### getRequestURI

    public java.lang.String getRequestURI()

  Specified by:
    `getRequestURI` in interface `RequestWrapper`
  See Also:
    `HttpServletRequest.getRequestURI()`

### getRequestURL

    public java.lang.StringBuffer getRequestURL()

  Specified by:
    `getRequestURL` in interface `RequestWrapper`
  See Also:
    `HttpServletRequest.getRequestURL()`

### getScheme

    public java.lang.String getScheme()

  Specified by:
    `getScheme` in interface `RequestWrapper`
  See Also:
    `ServletRequest.getScheme()`

### getServerName

    public java.lang.String getServerName()

  Specified by:
    `getServerName` in interface `RequestWrapper`
  See Also:
    `ServletRequest.getServerName()`

### getServerPort

    public int getServerPort()

  Specified by:
    `getServerPort` in interface `RequestWrapper`
  See Also:
    `ServletRequest.getServerPort()`

### getServletPath

    public java.lang.String getServletPath()

  Specified by:
    `getServletPath` in interface `RequestWrapper`
  See Also:
    `HttpServletRequest.getServletPath()`

### getSession

    public SessionWrapper getSession()

  Specified by:
    `getSession` in interface `RequestWrapper`
  See Also:
    `HttpServletRequest.getSession()`

### getSession

    public SessionWrapper getSession(boolean arg0)

  Specified by:
    `getSession` in interface `RequestWrapper`
  See Also:
    `HttpServletRequest.getSession(boolean)`

### getUserPrincipal

    public java.security.Principal getUserPrincipal()

  Specified by:
    `getUserPrincipal` in interface `RequestWrapper`
  See Also:
    `HttpServletRequest.getUserPrincipal()`

### isRequestedSessionIdFromCookie

    public boolean isRequestedSessionIdFromCookie()

  Specified by:
    `isRequestedSessionIdFromCookie` in interface `RequestWrapper`
  See Also:
    `HttpServletRequest.isRequestedSessionIdFromCookie()`

### isRequestedSessionIdFromURL

    public boolean isRequestedSessionIdFromURL()

  Specified by:
    `isRequestedSessionIdFromURL` in interface `RequestWrapper`
  See Also:
    `HttpServletRequest.isRequestedSessionIdFromURL()`

### isRequestedSessionIdValid

    public boolean isRequestedSessionIdValid()

  Specified by:
    `isRequestedSessionIdValid` in interface `RequestWrapper`
  See Also:
    `HttpServletRequest.isRequestedSessionIdValid()`

### isSecure

    public boolean isSecure()

  Specified by:
    `isSecure` in interface `RequestWrapper`
  See Also:
    `ServletRequest.isSecure()`

### isUserInRole

    public boolean isUserInRole(java.lang.String arg0)

  Specified by:
    `isUserInRole` in interface `RequestWrapper`
  See Also:
    `HttpServletRequest.isUserInRole(String)`

### removeAttribute

    public void removeAttribute(java.lang.String arg0)

  Specified by:
    `removeAttribute` in interface `RequestWrapper`
  See Also:
    `ServletRequest.removeAttribute(String)`

### setAttribute

    public void setAttribute(java.lang.String arg0,
                             java.lang.Object arg1)

  Specified by:
    `setAttribute` in interface `RequestWrapper`
  See Also:
    `ServletRequest.setAttribute(String, Object)`

### setCharacterEncoding

    public void setCharacterEncoding(java.lang.String arg0)
                              throws java.io.UnsupportedEncodingException

  Specified by:
    `setCharacterEncoding` in interface `RequestWrapper`
  Throws:
    `java.io.UnsupportedEncodingException`
  See Also:
    `ServletRequest.setCharacterEncoding(String)`

Copyright (C) Wolfgang Meier. All rights reserved.