Class FileCopyingMultipartFileReader
java.lang.Object
org.springframework.integration.http.multipart.FileCopyingMultipartFileReader
- All Implemented Interfaces:
MultipartFileReader<org.springframework.web.multipart.MultipartFile>
public class FileCopyingMultipartFileReader
extends 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
ConstructorsConstructorDescriptionCreate aFileCopyingMultipartFileReader
that creates temporary Files in the default temporary directory.FileCopyingMultipartFileReader
(File directory) Create aFileCopyingMultipartFileReader
that creates temporary Files in the given directory. -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.web.multipart.MultipartFile
readMultipartFile
(org.springframework.web.multipart.MultipartFile multipartFile) ReadMultipartFile
content.void
Specify the prefix to use for temporary files.void
Specify the suffix to use for temporary files.
-
Constructor Details
-
FileCopyingMultipartFileReader
public FileCopyingMultipartFileReader()Create aFileCopyingMultipartFileReader
that creates temporary Files in the default temporary directory. -
FileCopyingMultipartFileReader
Create aFileCopyingMultipartFileReader
that creates temporary Files in the given directory.- Parameters:
directory
- The directory.
-
-
Method Details
-
setPrefix
Specify the prefix to use for temporary files.- Parameters:
prefix
- The prefix.
-
setSuffix
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 IOException Description copied from interface:MultipartFileReader
ReadMultipartFile
content.- Specified by:
readMultipartFile
in interfaceMultipartFileReader<org.springframework.web.multipart.MultipartFile>
- Parameters:
multipartFile
- The multipart file.- Returns:
- The result of reading the file.
- Throws:
IOException
- Any IOException.
-