Spring Integration

org.springframework.integration.http
Class FileCopyingMultipartFileReader

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

public class FileCopyingMultipartFileReader
extends 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
Author:
Mark Fisher

Constructor Summary
FileCopyingMultipartFileReader()
          Create a FileCopyingMultipartFileReader that creates temporary Files in the default temporary directory.
FileCopyingMultipartFileReader(File directory)
          Create a FileCopyingMultipartFileReader that creates temporary Files in the given directory.
 
Method Summary
 MultipartFile readMultipartFile(MultipartFile multipartFile)
          Reads MultipartFile content.
 void setPrefix(String prefix)
          Specify the prefix to use for temporary files.
 void setSuffix(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(File directory)
Create a FileCopyingMultipartFileReader that creates temporary Files in the given directory.

Method Detail

setPrefix

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


setSuffix

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


readMultipartFile

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

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

Spring Integration

Copyright © 2010. All Rights Reserved.