org.springframework.integration.http.multipart
Class FileCopyingMultipartFileReader

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

public class FileCopyingMultipartFileReader
extends java.lang.Object
implements MultipartFileReader<MultipartFile>

MultipartFileReader implementation that copies the MulitpartFile'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
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
 MultipartFile readMultipartFile(MultipartFile multipartFile)
          Reads 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 Detail

FileCopyingMultipartFileReader

public FileCopyingMultipartFileReader()
Create a FileCopyingMultipartFileReader that creates temporary Files in the default temporary directory.


FileCopyingMultipartFileReader

public FileCopyingMultipartFileReader(java.io.File directory)
Create a FileCopyingMultipartFileReader that creates temporary Files in the given directory.

Method Detail

setPrefix

public void setPrefix(java.lang.String prefix)
Specify the prefix to use for temporary files.


setSuffix

public void setSuffix(java.lang.String suffix)
Specify the suffix to use for temporary files.


readMultipartFile

public MultipartFile readMultipartFile(MultipartFile multipartFile)
                                throws java.io.IOException
Description copied from interface: MultipartFileReader
Reads MultipartFile content.

Specified by:
readMultipartFile in interface MultipartFileReader<MultipartFile>
Throws:
java.io.IOException