org.springframework.web.multipart.support

Class DefaultMultipartHttpServletRequest

    • Constructor Detail

      • DefaultMultipartHttpServletRequest

        public DefaultMultipartHttpServletRequest(HttpServletRequest request,
                                                  MultiValueMap<java.lang.String,MultipartFile> mpFiles,
                                                  java.util.Map<java.lang.String,java.lang.String[]> mpParams,
                                                  java.util.Map<java.lang.String,java.lang.String> mpParamContentTypes)
        Wrap the given HttpServletRequest in a MultipartHttpServletRequest.
        Parameters:
        request - the servlet request to wrap
        mpFiles - a map of the multipart files
        mpParams - a map of the parameters to expose, with Strings as keys and String arrays as values
      • DefaultMultipartHttpServletRequest

        public DefaultMultipartHttpServletRequest(HttpServletRequest request)
        Wrap the given HttpServletRequest in a MultipartHttpServletRequest.
        Parameters:
        request - the servlet request to wrap
    • Method Detail

      • getParameterNames

        public java.util.Enumeration<java.lang.String> getParameterNames()
        Description copied from class: javax.servlet.ServletRequestWrapper
        The default behavior of this method is to return getParameterNames() on the wrapped request object.
        Specified by:
        getParameterNames in interface ServletRequest
        Overrides:
        getParameterNames in class ServletRequestWrapper
        Returns:
        an Enumeration of String objects, each String containing the name of a request parameter; or an empty Enumeration if the request has no parameters
      • getParameterMap

        public java.util.Map<java.lang.String,java.lang.String[]> getParameterMap()
        Description copied from class: javax.servlet.ServletRequestWrapper
        The default behavior of this method is to return getParameterMap() on the wrapped request object.
        Specified by:
        getParameterMap in interface ServletRequest
        Overrides:
        getParameterMap in class ServletRequestWrapper
        Returns:
        an immutable java.util.Map containing parameter names as keys and parameter values as map values. The keys in the parameter map are of type String. The values in the parameter map are of type String array.
      • getMultipartContentType

        public java.lang.String getMultipartContentType(java.lang.String paramOrFileName)
        Description copied from interface: MultipartRequest
        Determine the content type of the specified request part.
        Parameters:
        paramOrFileName - the name of the part
        Returns:
        the associated content type, or null if not defined
      • getMultipartHeaders

        public HttpHeaders getMultipartHeaders(java.lang.String paramOrFileName)
        Description copied from interface: MultipartHttpServletRequest
        Return the headers associated with the specified part of the multipart request.

        If the underlying implementation supports access to headers, then all headers are returned. Otherwise, the returned headers will include a 'Content-Type' header at the very least.

      • setMultipartParameters

        protected final void setMultipartParameters(java.util.Map<java.lang.String,java.lang.String[]> multipartParameters)
        Set a Map with parameter names as keys and String array objects as values. To be invoked by subclasses on initialization.
      • setMultipartParameterContentTypes

        protected final void setMultipartParameterContentTypes(java.util.Map<java.lang.String,java.lang.String> multipartParameterContentTypes)
        Set a Map with parameter names as keys and content type Strings as values. To be invoked by subclasses on initialization.
      • getMultipartParameterContentTypes

        protected java.util.Map<java.lang.String,java.lang.String> getMultipartParameterContentTypes()
        Obtain the multipart parameter content type Map for retrieval, lazily initializing it if necessary.
        See Also:
        AbstractMultipartHttpServletRequest.initializeMultipart()