接口 MultipartRequest
- 所有已知子接口:
MultipartHttpServletRequest
- 所有已知实现类:
AbstractMultipartHttpServletRequest
,DefaultMultipartHttpServletRequest
,MockMultipartHttpServletRequest
,StandardMultipartHttpServletRequest
public interface MultipartRequest
This interface defines the multipart request access operations that are exposed for actual multipart requests. It is extended byMultipartHttpServletRequest
.- 从以下版本开始:
- 2.5.2
- 作者:
- Juergen Hoeller, Arjen Poutsma
方法概要
所有方法 实例方法 抽象方法 修饰符和类型 方法 说明 MultipartFile
getFile(String name)
Return the contents plus description of an uploaded file in this request, ornull
if it does not exist.Map<String,MultipartFile>
getFileMap()
Return aMap
of the multipart files contained in this request.Iterator<String>
getFileNames()
Return anIterator
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<String,MultipartFile>
getMultiFileMap()
Return aMultiValueMap
of the multipart files contained in this request.String
getMultipartContentType(String paramOrFileName)
Determine the content type of the specified request part.
方法详细资料
getFileNames
Iterator<String> getFileNames()
Return anIterator
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.- 返回:
- the names of the files
getFile
@Nullable MultipartFile getFile(String name)
Return the contents plus description of an uploaded file in this request, ornull
if it does not exist.- 参数:
name
- a String specifying the parameter name of the multipart file- 返回:
- the uploaded content in the form of a
MultipartFile
object
getFiles
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.- 参数:
name
- a String specifying the parameter name of the multipart file- 返回:
- the uploaded content in the form of a
MultipartFile
list - 从以下版本开始:
- 3.0
getFileMap
Map<String,MultipartFile> getFileMap()
Return aMap
of the multipart files contained in this request.- 返回:
- a map containing the parameter names as keys, and the
MultipartFile
objects as values
getMultiFileMap
MultiValueMap<String,MultipartFile> getMultiFileMap()
Return aMultiValueMap
of the multipart files contained in this request.- 返回:
- a map containing the parameter names as keys, and a list of
MultipartFile
objects as values - 从以下版本开始:
- 3.0
getMultipartContentType
@Nullable String getMultipartContentType(String paramOrFileName)
Determine the content type of the specified request part.- 参数:
paramOrFileName
- the name of the part- 返回:
- the associated content type, or
null
if not defined - 从以下版本开始:
- 3.1