Class UploadedMultipartFile

java.lang.Object
org.springframework.integration.http.multipart.UploadedMultipartFile
All Implemented Interfaces:
org.springframework.core.io.InputStreamSource, org.springframework.web.multipart.MultipartFile

public class UploadedMultipartFile extends Object implements org.springframework.web.multipart.MultipartFile
A MultipartFile implementation that represents an uploaded File. The actual file content either exists in memory (in a byte array) or in a File.
Since:
2.0
  • Constructor Details

    • UploadedMultipartFile

      public UploadedMultipartFile(File file, long size, String contentType, String formParameterName, String originalFilename)
    • UploadedMultipartFile

      public UploadedMultipartFile(byte[] bytes, String contentType, String formParameterName, String originalFilename)
  • Method Details

    • getName

      public String getName()
      Specified by:
      getName in interface org.springframework.web.multipart.MultipartFile
    • getBytes

      public byte[] getBytes() throws IOException
      Specified by:
      getBytes in interface org.springframework.web.multipart.MultipartFile
      Throws:
      IOException
    • getContentType

      public String getContentType()
      Specified by:
      getContentType in interface org.springframework.web.multipart.MultipartFile
    • getInputStream

      public InputStream getInputStream() throws IOException
      Specified by:
      getInputStream in interface org.springframework.core.io.InputStreamSource
      Specified by:
      getInputStream in interface org.springframework.web.multipart.MultipartFile
      Throws:
      IOException
    • getOriginalFilename

      public String getOriginalFilename()
      Specified by:
      getOriginalFilename in interface org.springframework.web.multipart.MultipartFile
    • getSize

      public long getSize()
      Specified by:
      getSize in interface org.springframework.web.multipart.MultipartFile
    • isEmpty

      public boolean isEmpty()
      Specified by:
      isEmpty in interface org.springframework.web.multipart.MultipartFile
    • transferTo

      public void transferTo(File dest) throws IOException, IllegalStateException
      Specified by:
      transferTo in interface org.springframework.web.multipart.MultipartFile
      Throws:
      IOException
      IllegalStateException