org.springframework.web.multipart

Interface MultipartRequest

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method and Description
      MultipartFile getFile(java.lang.String name)
      Return the contents plus description of an uploaded file in this request, or null if it does not exist.
      java.util.Map<java.lang.String,MultipartFile> getFileMap()
      Return a Map of the multipart files contained in this request.
      java.util.Iterator<java.lang.String> getFileNames()
      Return an Iterator of String objects containing the parameter names of the multipart files contained in this request.
      java.util.List<MultipartFile> getFiles(java.lang.String name)
      Return the contents plus description of uploaded files in this request, or an empty list if it does not exist.
      MultiValueMap<java.lang.String,MultipartFile> getMultiFileMap()
      Return a MultiValueMap of the multipart files contained in this request.
      java.lang.String getMultipartContentType(java.lang.String paramOrFileName)
      Determine the content type of the specified request part.
    • Method Detail

      • getFileNames

        java.util.Iterator<java.lang.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
      • getFile

        @Nullable
        MultipartFile getFile(java.lang.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:
        the uploaded content in the form of a MultipartFile object
      • getFiles

        java.util.List<MultipartFile> getFiles(java.lang.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:
        the uploaded content in the form of a MultipartFile list
        Since:
        3.0
      • getFileMap

        java.util.Map<java.lang.String,MultipartFile> 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
      • getMultiFileMap

        MultiValueMap<java.lang.String,MultipartFile> 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
        Since:
        3.0
      • getMultipartContentType

        @Nullable
        java.lang.String getMultipartContentType(java.lang.String paramOrFileName)
        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
        Since:
        3.1