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 java.lang.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 Summary

    Constructors 
    Constructor Description
    UploadedMultipartFile​(byte[] bytes, java.lang.String contentType, java.lang.String formParameterName, java.lang.String originalFilename)  
    UploadedMultipartFile​(java.io.File file, long size, java.lang.String contentType, java.lang.String formParameterName, java.lang.String originalFilename)  
  • Method Summary

    Modifier and Type Method Description
    byte[] getBytes()  
    java.lang.String getContentType()  
    java.io.InputStream getInputStream()  
    java.lang.String getName()  
    java.lang.String getOriginalFilename()  
    long getSize()  
    boolean isEmpty()  
    void transferTo​(java.io.File dest)  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.springframework.web.multipart.MultipartFile

    getResource, transferTo
  • Constructor Details

    • UploadedMultipartFile

      public UploadedMultipartFile​(java.io.File file, long size, java.lang.String contentType, java.lang.String formParameterName, java.lang.String originalFilename)
    • UploadedMultipartFile

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

    • getName

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

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

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

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

      public java.lang.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​(java.io.File dest) throws java.io.IOException, java.lang.IllegalStateException
      Specified by:
      transferTo in interface org.springframework.web.multipart.MultipartFile
      Throws:
      java.io.IOException
      java.lang.IllegalStateException