Class FileUploadRequestWrapper

java.lang.Object
jakarta.servlet.ServletRequestWrapper
jakarta.servlet.http.HttpServletRequestWrapper
org.deltava.servlet.filter.FileUploadRequestWrapper
All Implemented Interfaces:
jakarta.servlet.http.HttpServletRequest, jakarta.servlet.ServletRequest

public class FileUploadRequestWrapper extends jakarta.servlet.http.HttpServletRequestWrapper
A serlvet request wrapper for File Upload POST requests. This wrapper is created by parsing a multi-part form request; file parts are stored within the request, and this wrapper is used to access the parameter parts by the standard method calls contained within the Java Servlet API.
Since:
1.0
Version:
11.1
Author:
Luke
  • Field Summary

    Fields inherited from interface jakarta.servlet.http.HttpServletRequest

    BASIC_AUTH, CLIENT_CERT_AUTH, DIGEST_AUTH, FORM_AUTH
  • Constructor Summary

    Constructors
    Constructor
    Description
    FileUploadRequestWrapper(jakarta.servlet.http.HttpServletRequest req)
    Create a new request wrapper from an existing servlet request.
  • Method Summary

    Modifier and Type
    Method
    Description
    (package private) void
    addParameter(String pName, String... pValues)
    Adds a parameter to the request from a multi-part form.
    final String
     
    final Map<String,String[]>
    Returns the parameters as a map of String arrays.
    Returns all parameter names.
    final String[]
    Returns the value(s) of a request parameter.

    Methods inherited from class jakarta.servlet.http.HttpServletRequestWrapper

    authenticate, changeSessionId, getAuthType, getContextPath, getCookies, getDateHeader, getHeader, getHeaderNames, getHeaders, getHttpServletMapping, getIntHeader, getMethod, getPart, getParts, getPathInfo, getPathTranslated, getQueryString, getRemoteUser, getRequestedSessionId, getRequestURI, getRequestURL, getServletPath, getSession, getSession, getTrailerFields, getUserPrincipal, isRequestedSessionIdFromCookie, isRequestedSessionIdFromURL, isRequestedSessionIdValid, isTrailerFieldsReady, isUserInRole, login, logout, newPushBuilder, upgrade

    Methods inherited from class jakarta.servlet.ServletRequestWrapper

    getAsyncContext, getAttribute, getAttributeNames, getCharacterEncoding, getContentLength, getContentLengthLong, getContentType, getDispatcherType, getInputStream, getLocalAddr, getLocale, getLocales, getLocalName, getLocalPort, getProtocol, getProtocolRequestId, getReader, getRemoteAddr, getRemoteHost, getRemotePort, getRequest, getRequestDispatcher, getRequestId, getScheme, getServerName, getServerPort, getServletConnection, getServletContext, isAsyncStarted, isAsyncSupported, isSecure, isWrapperFor, isWrapperFor, removeAttribute, setAttribute, setCharacterEncoding, setCharacterEncoding, setRequest, startAsync, startAsync

    Methods inherited from class Object

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

    Methods inherited from interface jakarta.servlet.ServletRequest

    getAsyncContext, getAttribute, getAttributeNames, getCharacterEncoding, getContentLength, getContentLengthLong, getContentType, getDispatcherType, getInputStream, getLocalAddr, getLocale, getLocales, getLocalName, getLocalPort, getProtocol, getProtocolRequestId, getReader, getRemoteAddr, getRemoteHost, getRemotePort, getRequestDispatcher, getRequestId, getScheme, getServerName, getServerPort, getServletConnection, getServletContext, isAsyncStarted, isAsyncSupported, isSecure, removeAttribute, setAttribute, setCharacterEncoding, setCharacterEncoding, startAsync, startAsync
  • Constructor Details

    • FileUploadRequestWrapper

      public FileUploadRequestWrapper(jakarta.servlet.http.HttpServletRequest req)
      Create a new request wrapper from an existing servlet request.
      Parameters:
      req - the servlet request
  • Method Details

    • addParameter

      void addParameter(String pName, String... pValues)
      Adds a parameter to the request from a multi-part form. If a parameter has multiple values, this method can be called multiple times.
      Parameters:
      pName - the parameter name
      pValues - the parameter values
    • getParameter

      public final String getParameter(String pName)
      Specified by:
      getParameter in interface jakarta.servlet.ServletRequest
      Overrides:
      getParameter in class jakarta.servlet.ServletRequestWrapper
    • getParameterValues

      public final String[] getParameterValues(String pName)
      Returns the value(s) of a request parameter.
      Specified by:
      getParameterValues in interface jakarta.servlet.ServletRequest
      Overrides:
      getParameterValues in class jakarta.servlet.ServletRequestWrapper
      Returns:
      the parameter value(s)
    • getParameterMap

      public final Map<String,String[]> getParameterMap()
      Returns the parameters as a map of String arrays.
      Specified by:
      getParameterMap in interface jakarta.servlet.ServletRequest
      Overrides:
      getParameterMap in class jakarta.servlet.ServletRequestWrapper
      Returns:
      a Map of String[] arrays
    • getParameterNames

      public final Enumeration<String> getParameterNames()
      Returns all parameter names.
      Specified by:
      getParameterNames in interface jakarta.servlet.ServletRequest
      Overrides:
      getParameterNames in class jakarta.servlet.ServletRequestWrapper
      Returns:
      an Enumeration of parameter names