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.Constructor and Description |
---|
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. |
Modifier and Type | Method and Description |
---|---|
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.
|
public FileCopyingMultipartFileReader()
FileCopyingMultipartFileReader
that creates temporary
Files in the default temporary directory.public FileCopyingMultipartFileReader(java.io.File directory)
FileCopyingMultipartFileReader
that creates temporary
Files in the given directory.public void setPrefix(java.lang.String prefix)
public void setSuffix(java.lang.String suffix)
public org.springframework.web.multipart.MultipartFile readMultipartFile(org.springframework.web.multipart.MultipartFile multipartFile) throws java.io.IOException
MultipartFileReader
MultipartFile
content.readMultipartFile
in interface MultipartFileReader<org.springframework.web.multipart.MultipartFile>
java.io.IOException