接口 MultipartRequest

所有已知实现类:
AbstractMultipartRequest, ServletMultipartRequest

public interface MultipartRequest
This interface defines the multipart request access operations that are exposed for actual multipart requests.
从以下版本开始:
4.0 2022/3/17 17:26
作者:
Juergen Hoeller, Arjen Poutsma, Harry Yang
  • 方法详细资料

    • getFileNames

      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.
      返回:
      the names of the files
    • getFile

      @Nullable MultipartFile getFile(String name)
      Return the contents plus description of an uploaded file in this request, or null 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
    • multipartData

      List<Multipart> multipartData(String name)
      Return the contents in this request, or an empty list if it does not exist.
      参数:
      name - a String specifying the parameter name of the multipart
    • getFileMap

      Map<String,MultipartFile> getFileMap()
      Return a Map of the multipart files contained in this request.
      返回:
      a map containing the parameter names as keys, and the MultipartFile objects as values
    • getMultipartFiles

      cn.taketoday.util.MultiValueMap<String,MultipartFile> getMultipartFiles()
      Return a MultiValueMap of the multipart files contained in this request.
      返回:
      a map containing the parameter names as keys, and a list of MultipartFile objects as values
    • multipartData

      cn.taketoday.util.MultiValueMap<String,Multipart> multipartData() throws IOException
      Get the parts of a multipart request, provided the Content-Type is "multipart/form-data", or an exception otherwise.
      返回:
      the multipart data, mapping from name to part(s)
      抛出:
      IOException - if an I/O error occurred during the retrieval
      NotMultipartRequestException - if this request is not of type "multipart/form-data"
      另请参阅:
    • 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
    • getMultipartHeaders

      @Nullable HttpHeaders getMultipartHeaders(String paramOrFileName)
      Return the headers for the specified part of the multipart request.

      If the underlying implementation supports access to part headers, then all headers are returned. Otherwise, e.g. for a file upload, the returned headers may expose a 'Content-Type' if available.

    • cleanup

      void cleanup()
      Cleanup any resources used for the multipart handling, like a storage for the uploaded files.