org.springframework.web.multipart.support

Class AbstractMultipartHttpServletRequest

    • Constructor Detail

      • AbstractMultipartHttpServletRequest

        protected AbstractMultipartHttpServletRequest(HttpServletRequest request)
        Wrap the given HttpServletRequest in a MultipartHttpServletRequest.
        Parameters:
        request - the request to wrap
    • Method Detail

      • getFileNames

        public java.util.Iterator<java.lang.String> getFileNames()
        Description copied from interface: MultipartRequest
        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.
        Specified by:
        getFileNames in interface MultipartRequest
        Returns:
        the names of the files
      • getFile

        public MultipartFile getFile(java.lang.String name)
        Description copied from interface: MultipartRequest
        Return the contents plus description of an uploaded file in this request, or null if it does not exist.
        Specified by:
        getFile in interface MultipartRequest
        Parameters:
        name - a String specifying the parameter name of the multipart file
        Returns:
        the uploaded content in the form of a MultipartFile object
      • getFiles

        public java.util.List<MultipartFile> getFiles(java.lang.String name)
        Description copied from interface: MultipartRequest
        Return the contents plus description of uploaded files in this request, or an empty list if it does not exist.
        Specified by:
        getFiles in interface MultipartRequest
        Parameters:
        name - a String specifying the parameter name of the multipart file
        Returns:
        the uploaded content in the form of a MultipartFile list
      • getFileMap

        public java.util.Map<java.lang.String,MultipartFile> getFileMap()
        Description copied from interface: MultipartRequest
        Return a Map of the multipart files contained in this request.
        Specified by:
        getFileMap in interface MultipartRequest
        Returns:
        a map containing the parameter names as keys, and the MultipartFile objects as values
      • isResolved

        public boolean isResolved()
        Determine whether the underlying multipart request has been resolved.
        Returns:
        true when eagerly initialized or lazily triggered, false in case of a lazy-resolution request that got aborted before any parameters or multipart files have been accessed
        Since:
        4.3.15
        See Also:
        getMultipartFiles()
      • setMultipartFiles

        protected final void setMultipartFiles(MultiValueMap<java.lang.String,MultipartFile> multipartFiles)
        Set a Map with parameter names as keys and list of MultipartFile objects as values. To be invoked by subclasses on initialization.
      • initializeMultipart

        protected void initializeMultipart()
        Lazily initialize the multipart request, if possible. Only called if not already eagerly initialized.