Class FileCopyingMultipartFileReader

java.lang.Object
org.springframework.integration.http.multipart.FileCopyingMultipartFileReader
All Implemented Interfaces:
MultipartFileReader<org.springframework.web.multipart.MultipartFile>

public class FileCopyingMultipartFileReader
extends java.lang.Object
implements MultipartFileReader<org.springframework.web.multipart.MultipartFile>
MultipartFileReader implementation that copies the MultipartFile's content to a new temporary File in the specified directory. If no directory is provided, the Files will be created in the default temporary directory.
Since:
2.0
  • Constructor Summary

    Constructors 
    Constructor Description
    FileCopyingMultipartFileReader()
    Create a FileCopyingMultipartFileReader that creates temporary Files in the default temporary directory.
    FileCopyingMultipartFileReader​(java.io.File directory)
    Create a FileCopyingMultipartFileReader that creates temporary Files in the given directory.
  • Method Summary

    Modifier and Type Method Description
    org.springframework.web.multipart.MultipartFile readMultipartFile​(org.springframework.web.multipart.MultipartFile multipartFile)
    Read MultipartFile content.
    void setPrefix​(java.lang.String prefix)
    Specify the prefix to use for temporary files.
    void setSuffix​(java.lang.String suffix)
    Specify the suffix to use for temporary files.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • setPrefix

      public void setPrefix​(java.lang.String prefix)
      Specify the prefix to use for temporary files.
      Parameters:
      prefix - The prefix.
    • setSuffix

      public void setSuffix​(java.lang.String suffix)
      Specify the suffix to use for temporary files.
      Parameters:
      suffix - The suffix.
    • readMultipartFile

      public org.springframework.web.multipart.MultipartFile readMultipartFile​(org.springframework.web.multipart.MultipartFile multipartFile) throws java.io.IOException
      Description copied from interface: MultipartFileReader
      Read MultipartFile content.
      Specified by:
      readMultipartFile in interface MultipartFileReader<org.springframework.web.multipart.MultipartFile>
      Parameters:
      multipartFile - The multipart file.
      Returns:
      The result of reading the file.
      Throws:
      java.io.IOException - Any IOException.