Package org.apache.commons.fileupload2.javax

# Class JavaxMockHttpServletRequest

java.lang.Object
org.apache.commons.fileupload2.javax.JavaxMockHttpServletRequest

All Implemented Interfaces:
  `javax.servlet.http.HttpServletRequest`, `javax.servlet.ServletRequest`

public class JavaxMockHttpServletRequest extends Object implements javax.servlet.http.HttpServletRequest
Test fixture for `HttpServletRequest`.

- ## Field Summary

  ### Fields inherited from interface javax.servlet.http.HttpServletRequest

  `BASIC_AUTH, CLIENT_CERT_AUTH, DIGEST_AUTH, FORM_AUTH`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `JavaxMockHttpServletRequest(byte[] requestData, String contentType)`
  Creates a new instance with the given request data and content type.
  `JavaxMockHttpServletRequest(InputStream requestInputStream, long requestLength, String contentType, int readLimit)`
  Creates a new instance with the given request data and content type.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Object`
  `getAttribute(String arg0)`
  `Enumeration<String>`
  `getAttributeNames()`
  `String`
  `getAuthType()`
  `String`
  `getCharacterEncoding()`
  `int`
  `getContentLength()`
  `String`
  `getContentType()`
  `String`
  `getContextPath()`
  `javax.servlet.http.Cookie[]`
  `getCookies()`
  `long`
  `getDateHeader(String arg0)`
  `String`
  `getHeader(String headerName)`
  `Enumeration<String>`
  `getHeaderNames()`
  `Enumeration<String>`
  `getHeaders(String arg0)`
  `javax.servlet.ServletInputStream`
  `getInputStream()`
  `int`
  `getIntHeader(String arg0)`
  `String`
  `getLocalAddr()`
  `Locale`
  `getLocale()`
  `Enumeration<Locale>`
  `getLocales()`
  `String`
  `getLocalName()`
  `int`
  `getLocalPort()`
  `String`
  `getMethod()`
  `String`
  `getParameter(String arg0)`
  `Map<String,String[]>`
  `getParameterMap()`
  `Enumeration<String>`
  `getParameterNames()`
  `String[]`
  `getParameterValues(String arg0)`
  `String`
  `getPathInfo()`
  `String`
  `getPathTranslated()`
  `String`
  `getProtocol()`
  `String`
  `getQueryString()`
  `BufferedReader`
  `getReader()`
  `String`
  `getRealPath(String arg0)`
  Deprecated.
  `String`
  `getRemoteAddr()`
  `String`
  `getRemoteHost()`
  `int`
  `getRemotePort()`
  `String`
  `getRemoteUser()`
  `javax.servlet.RequestDispatcher`
  `getRequestDispatcher(String arg0)`
  `String`
  `getRequestedSessionId()`
  `String`
  `getRequestURI()`
  `StringBuffer`
  `getRequestURL()`
  `String`
  `getScheme()`
  `String`
  `getServerName()`
  `int`
  `getServerPort()`
  `String`
  `getServletPath()`
  `javax.servlet.http.HttpSession`
  `getSession()`
  `javax.servlet.http.HttpSession`
  `getSession(boolean arg0)`
  `Principal`
  `getUserPrincipal()`
  `boolean`
  `isRequestedSessionIdFromCookie()`
  `boolean`
  `isRequestedSessionIdFromUrl()`
  Deprecated.
  `boolean`
  `isRequestedSessionIdFromURL()`
  `boolean`
  `isRequestedSessionIdValid()`
  `boolean`
  `isSecure()`
  `boolean`
  `isUserInRole(String arg0)`
  `void`
  `removeAttribute(String arg0)`
  `void`
  `setAttribute(String arg0, Object arg1)`
  `void`
  `setCharacterEncoding(String arg0)`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### JavaxMockHttpServletRequest

    public JavaxMockHttpServletRequest(byte[] requestData, String contentType)
    Creates a new instance with the given request data and content type.

  - ### JavaxMockHttpServletRequest

    public JavaxMockHttpServletRequest(InputStream requestInputStream, long requestLength, String contentType, int readLimit)
    Creates a new instance with the given request data and content type.

- ## Method Details

  - ### getAttribute

    public Object getAttribute(String arg0)
    Specified by:
      `getAttribute` in interface `javax.servlet.ServletRequest`
    See Also:
      - `ServletRequest.getAttribute(String)`

  - ### getAttributeNames

    public Enumeration<String> getAttributeNames()
    Specified by:
      `getAttributeNames` in interface `javax.servlet.ServletRequest`
    See Also:
      - `ServletRequest.getAttributeNames()`

  - ### getAuthType

    public String getAuthType()
    Specified by:
      `getAuthType` in interface `javax.servlet.http.HttpServletRequest`
    See Also:
      - `HttpServletRequest.getAuthType()`

  - ### getCharacterEncoding

    public String getCharacterEncoding()
    Specified by:
      `getCharacterEncoding` in interface `javax.servlet.ServletRequest`
    See Also:
      - `ServletRequest.getCharacterEncoding()`

  - ### getContentLength

    public int getContentLength()
    Specified by:
      `getContentLength` in interface `javax.servlet.ServletRequest`
    See Also:
      - `ServletRequest.getContentLength()`

  - ### getContentType

    public String getContentType()
    Specified by:
      `getContentType` in interface `javax.servlet.ServletRequest`
    See Also:
      - `ServletRequest.getContentType()`

  - ### getContextPath

    public String getContextPath()
    Specified by:
      `getContextPath` in interface `javax.servlet.http.HttpServletRequest`
    See Also:
      - `HttpServletRequest.getContextPath()`

  - ### getCookies

    public javax.servlet.http.Cookie[] getCookies()
    Specified by:
      `getCookies` in interface `javax.servlet.http.HttpServletRequest`
    See Also:
      - `HttpServletRequest.getCookies()`

  - ### getDateHeader

    public long getDateHeader(String arg0)
    Specified by:
      `getDateHeader` in interface `javax.servlet.http.HttpServletRequest`
    See Also:
      - `HttpServletRequest.getDateHeader(String)`

  - ### getHeader

    public String getHeader(String headerName)
    Specified by:
      `getHeader` in interface `javax.servlet.http.HttpServletRequest`
    See Also:
      - `HttpServletRequest.getHeader(String)`

  - ### getHeaderNames

    public Enumeration<String> getHeaderNames()
    Specified by:
      `getHeaderNames` in interface `javax.servlet.http.HttpServletRequest`
    See Also:
      - `HttpServletRequest.getHeaderNames()`

  - ### getHeaders

    public Enumeration<String> getHeaders(String arg0)
    Specified by:
      `getHeaders` in interface `javax.servlet.http.HttpServletRequest`
    See Also:
      - `HttpServletRequest.getHeaders(String)`

  - ### getInputStream

    public javax.servlet.ServletInputStream getInputStream() throws IOException
    Specified by:
      `getInputStream` in interface `javax.servlet.ServletRequest`
    Throws:
      `IOException`
    See Also:
      - `ServletRequest.getInputStream()`

  - ### getIntHeader

    public int getIntHeader(String arg0)
    Specified by:
      `getIntHeader` in interface `javax.servlet.http.HttpServletRequest`
    See Also:
      - `HttpServletRequest.getIntHeader(String)`

  - ### getLocalAddr

    public String getLocalAddr()
    Specified by:
      `getLocalAddr` in interface `javax.servlet.ServletRequest`
    See Also:
      - `ServletRequest.getLocalAddr()`

  - ### getLocale

    public Locale getLocale()
    Specified by:
      `getLocale` in interface `javax.servlet.ServletRequest`
    See Also:
      - `ServletRequest.getLocale()`

  - ### getLocales

    public Enumeration<Locale> getLocales()
    Specified by:
      `getLocales` in interface `javax.servlet.ServletRequest`
    See Also:
      - `ServletRequest.getLocales()`

  - ### getLocalName

    public String getLocalName()
    Specified by:
      `getLocalName` in interface `javax.servlet.ServletRequest`
    See Also:
      - `ServletRequest.getLocalName()`

  - ### getLocalPort

    public int getLocalPort()
    Specified by:
      `getLocalPort` in interface `javax.servlet.ServletRequest`
    See Also:
      - `ServletRequest.getLocalPort()`

  - ### getMethod

    public String getMethod()
    Specified by:
      `getMethod` in interface `javax.servlet.http.HttpServletRequest`
    See Also:
      - `HttpServletRequest.getMethod()`

  - ### getParameter

    public String getParameter(String arg0)
    Specified by:
      `getParameter` in interface `javax.servlet.ServletRequest`
    See Also:
      - `ServletRequest.getParameter(String)`

  - ### getParameterMap

    public Map<String,String[]> getParameterMap()
    Specified by:
      `getParameterMap` in interface `javax.servlet.ServletRequest`
    See Also:
      - `ServletRequest.getParameterMap()`

  - ### getParameterNames

    public Enumeration<String> getParameterNames()
    Specified by:
      `getParameterNames` in interface `javax.servlet.ServletRequest`
    See Also:
      - `ServletRequest.getParameterNames()`

  - ### getParameterValues

    public String[] getParameterValues(String arg0)
    Specified by:
      `getParameterValues` in interface `javax.servlet.ServletRequest`
    See Also:
      - `ServletRequest.getParameterValues(String)`

  - ### getPathInfo

    public String getPathInfo()
    Specified by:
      `getPathInfo` in interface `javax.servlet.http.HttpServletRequest`
    See Also:
      - `HttpServletRequest.getPathInfo()`

  - ### getPathTranslated

    public String getPathTranslated()
    Specified by:
      `getPathTranslated` in interface `javax.servlet.http.HttpServletRequest`
    See Also:
      - `HttpServletRequest.getPathTranslated()`

  - ### getProtocol

    public String getProtocol()
    Specified by:
      `getProtocol` in interface `javax.servlet.ServletRequest`
    See Also:
      - `ServletRequest.getProtocol()`

  - ### getQueryString

    public String getQueryString()
    Specified by:
      `getQueryString` in interface `javax.servlet.http.HttpServletRequest`
    See Also:
      - `HttpServletRequest.getQueryString()`

  - ### getReader

    public BufferedReader getReader() throws IOException
    Specified by:
      `getReader` in interface `javax.servlet.ServletRequest`
    Throws:
      `IOException`
    See Also:
      - `ServletRequest.getReader()`

  - ### getRealPath

    @Deprecated public String getRealPath(String arg0)
    Deprecated.
    Specified by:
      `getRealPath` in interface `javax.servlet.ServletRequest`
    See Also:
      - `ServletRequest.getRealPath(String)`

  - ### getRemoteAddr

    public String getRemoteAddr()
    Specified by:
      `getRemoteAddr` in interface `javax.servlet.ServletRequest`
    See Also:
      - `ServletRequest.getRemoteAddr()`

  - ### getRemoteHost

    public String getRemoteHost()
    Specified by:
      `getRemoteHost` in interface `javax.servlet.ServletRequest`
    See Also:
      - `ServletRequest.getRemoteHost()`

  - ### getRemotePort

    public int getRemotePort()
    Specified by:
      `getRemotePort` in interface `javax.servlet.ServletRequest`
    See Also:
      - `ServletRequest.getRemotePort()`

  - ### getRemoteUser

    public String getRemoteUser()
    Specified by:
      `getRemoteUser` in interface `javax.servlet.http.HttpServletRequest`
    See Also:
      - `HttpServletRequest.getRemoteUser()`

  - ### getRequestDispatcher

    public javax.servlet.RequestDispatcher getRequestDispatcher(String arg0)
    Specified by:
      `getRequestDispatcher` in interface `javax.servlet.ServletRequest`
    See Also:
      - `ServletRequest.getRequestDispatcher(String)`

  - ### getRequestedSessionId

    public String getRequestedSessionId()
    Specified by:
      `getRequestedSessionId` in interface `javax.servlet.http.HttpServletRequest`
    See Also:
      - `HttpServletRequest.getRequestedSessionId()`

  - ### getRequestURI

    public String getRequestURI()
    Specified by:
      `getRequestURI` in interface `javax.servlet.http.HttpServletRequest`
    See Also:
      - `HttpServletRequest.getRequestURI()`

  - ### getRequestURL

    public StringBuffer getRequestURL()
    Specified by:
      `getRequestURL` in interface `javax.servlet.http.HttpServletRequest`
    See Also:
      - `HttpServletRequest.getRequestURL()`

  - ### getScheme

    public String getScheme()
    Specified by:
      `getScheme` in interface `javax.servlet.ServletRequest`
    See Also:
      - `ServletRequest.getScheme()`

  - ### getServerName

    public String getServerName()
    Specified by:
      `getServerName` in interface `javax.servlet.ServletRequest`
    See Also:
      - `ServletRequest.getServerName()`

  - ### getServerPort

    public int getServerPort()
    Specified by:
      `getServerPort` in interface `javax.servlet.ServletRequest`
    See Also:
      - `ServletRequest.getServerPort()`

  - ### getServletPath

    public String getServletPath()
    Specified by:
      `getServletPath` in interface `javax.servlet.http.HttpServletRequest`
    See Also:
      - `HttpServletRequest.getServletPath()`

  - ### getSession

    public javax.servlet.http.HttpSession getSession()
    Specified by:
      `getSession` in interface `javax.servlet.http.HttpServletRequest`
    See Also:
      - `HttpServletRequest.getSession()`

  - ### getSession

    public javax.servlet.http.HttpSession getSession(boolean arg0)
    Specified by:
      `getSession` in interface `javax.servlet.http.HttpServletRequest`
    See Also:
      - `HttpServletRequest.getSession(boolean)`

  - ### getUserPrincipal

    public Principal getUserPrincipal()
    Specified by:
      `getUserPrincipal` in interface `javax.servlet.http.HttpServletRequest`
    See Also:
      - `HttpServletRequest.getUserPrincipal()`

  - ### isRequestedSessionIdFromCookie

    public boolean isRequestedSessionIdFromCookie()
    Specified by:
      `isRequestedSessionIdFromCookie` in interface `javax.servlet.http.HttpServletRequest`
    See Also:
      - `HttpServletRequest.isRequestedSessionIdFromCookie()`

  - ### isRequestedSessionIdFromUrl

    @Deprecated public boolean isRequestedSessionIdFromUrl()
    Deprecated.
    Specified by:
      `isRequestedSessionIdFromUrl` in interface `javax.servlet.http.HttpServletRequest`
    See Also:
      - `HttpServletRequest.isRequestedSessionIdFromUrl()`

  - ### isRequestedSessionIdFromURL

    public boolean isRequestedSessionIdFromURL()
    Specified by:
      `isRequestedSessionIdFromURL` in interface `javax.servlet.http.HttpServletRequest`
    See Also:
      - `HttpServletRequest.isRequestedSessionIdFromURL()`

  - ### isRequestedSessionIdValid

    public boolean isRequestedSessionIdValid()
    Specified by:
      `isRequestedSessionIdValid` in interface `javax.servlet.http.HttpServletRequest`
    See Also:
      - `HttpServletRequest.isRequestedSessionIdValid()`

  - ### isSecure

    public boolean isSecure()
    Specified by:
      `isSecure` in interface `javax.servlet.ServletRequest`
    See Also:
      - `ServletRequest.isSecure()`

  - ### isUserInRole

    public boolean isUserInRole(String arg0)
    Specified by:
      `isUserInRole` in interface `javax.servlet.http.HttpServletRequest`
    See Also:
      - `HttpServletRequest.isUserInRole(String)`

  - ### removeAttribute

    public void removeAttribute(String arg0)
    Specified by:
      `removeAttribute` in interface `javax.servlet.ServletRequest`
    See Also:
      - `ServletRequest.removeAttribute(String)`

  - ### setAttribute

    public void setAttribute(String arg0, Object arg1)
    Specified by:
      `setAttribute` in interface `javax.servlet.ServletRequest`
    See Also:
      - `ServletRequest.setAttribute(String, Object)`

  - ### setCharacterEncoding

    public void setCharacterEncoding(String arg0) throws UnsupportedEncodingException
    Specified by:
      `setCharacterEncoding` in interface `javax.servlet.ServletRequest`
    Throws:
      `UnsupportedEncodingException`
    See Also:
      - `ServletRequest.setCharacterEncoding(String)`