Spring Integration

org.springframework.integration.http.multipart
Class FileCopyingMultipartFileReader

java.lang.Object
  extended by 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 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
Author:
Mark Fisher

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
 org.springframework.web.multipart.MultipartFile readMultipartFile(org.springframework.web.multipart.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 org.springframework.web.multipart.MultipartFile readMultipartFile(org.springframework.web.multipart.MultipartFile multipartFile)
                                                                  throws java.io.IOException
Description copied from interface: MultipartFileReader
Reads MultipartFile content.

Specified by:
readMultipartFile in interface MultipartFileReader<org.springframework.web.multipart.MultipartFile>
Throws:
java.io.IOException

Spring Integration