public class FileCopyingMultipartFileReader extends Object implements MultipartFileReader<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.Constructor and Description |
---|
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. |
Modifier and Type | Method and Description |
---|---|
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.
|
public FileCopyingMultipartFileReader()
FileCopyingMultipartFileReader
that creates temporary
Files in the default temporary directory.public FileCopyingMultipartFileReader(File directory)
FileCopyingMultipartFileReader
that creates temporary
Files in the given directory.directory
- The directory.public void setPrefix(String prefix)
prefix
- The prefix.public void setSuffix(String suffix)
suffix
- The suffix.public MultipartFile readMultipartFile(MultipartFile multipartFile) throws IOException
MultipartFileReader
MultipartFile
content.readMultipartFile
in interface MultipartFileReader<MultipartFile>
multipartFile
- The multipart file.IOException
- Any IOException.