public abstract class

AbstractMultipartHttpServletRequest

extends HttpServletRequestWrapper
implements MultipartHttpServletRequest
java.lang.Object
   ↳ javax.servlet.ServletRequestWrapper
     ↳ javax.servlet.http.HttpServletRequestWrapper
       ↳ org.springframework.web.multipart.support.AbstractMultipartHttpServletRequest
Known Direct Subclasses

Class Overview

Abstract base implementation of the MultipartHttpServletRequest interface. Provides management of pre-generated MultipartFile instances.

Summary

[Expand]
Inherited Constants
From interface javax.servlet.http.HttpServletRequest
Protected Constructors
AbstractMultipartHttpServletRequest(HttpServletRequest request)
Wrap the given HttpServletRequest in a MultipartHttpServletRequest.
Public Methods
MultipartFile getFile(String name)
Return the contents plus description of an uploaded file in this request, or null if it does not exist.
Map<StringMultipartFile> getFileMap()
Return a Map of the multipart files contained in this request.
Iterator<String> getFileNames()
Return an Iterator of String objects containing the parameter names of the multipart files contained in this request.
List<MultipartFile> getFiles(String name)
Return the contents plus description of uploaded files in this request, or an empty list if it does not exist.
MultiValueMap<StringMultipartFile> getMultiFileMap()
Return a MultiValueMap of the multipart files contained in this request.
Protected Methods
MultiValueMap<StringMultipartFile> getMultipartFiles()
Obtain the MultipartFile Map for retrieval, lazily initializing it if necessary.
void initializeMultipart()
Lazily initialize the multipart request, if possible.
final void setMultipartFiles(MultiValueMap<StringMultipartFile> multipartFiles)
Set a Map with parameter names as keys and list of MultipartFile objects as values.
[Expand]
Inherited Methods
From class javax.servlet.http.HttpServletRequestWrapper
From class javax.servlet.ServletRequestWrapper
From class java.lang.Object
From interface javax.servlet.ServletRequest
From interface javax.servlet.http.HttpServletRequest
From interface org.springframework.web.multipart.MultipartRequest

Protected Constructors

protected AbstractMultipartHttpServletRequest (HttpServletRequest request)

Wrap the given HttpServletRequest in a MultipartHttpServletRequest.

Parameters
request the request to wrap

Public Methods

public MultipartFile getFile (String name)

Return the contents plus description of an uploaded file in this request, or null if it does not exist.

Parameters
name a String specifying the parameter name of the multipart file
Returns

public Map<StringMultipartFile> getFileMap ()

Return a Map of the multipart files contained in this request.

Returns
  • a map containing the parameter names as keys, and the MultipartFile objects as values

public Iterator<String> getFileNames ()

Return an Iterator of String objects containing the parameter names of the multipart files contained in this request. These are the field names of the form (like with normal parameters), not the original file names.

Returns
  • the names of the files

public List<MultipartFile> getFiles (String name)

Return the contents plus description of uploaded files in this request, or an empty list if it does not exist.

Parameters
name a String specifying the parameter name of the multipart file
Returns

public MultiValueMap<StringMultipartFile> getMultiFileMap ()

Return a MultiValueMap of the multipart files contained in this request.

Returns
  • a map containing the parameter names as keys, and a list of MultipartFile objects as values

Protected Methods

protected MultiValueMap<StringMultipartFile> getMultipartFiles ()

Obtain the MultipartFile Map for retrieval, lazily initializing it if necessary.

protected void initializeMultipart ()

Lazily initialize the multipart request, if possible. Only called if not already eagerly initialized.

protected final void setMultipartFiles (MultiValueMap<StringMultipartFile> multipartFiles)

Set a Map with parameter names as keys and list of MultipartFile objects as values. To be invoked by subclasses on initialization.