Package org.bremersee.minio
Class FileAwareMultipartFile
java.lang.Object
org.bremersee.minio.FileAwareMultipartFile
- All Implemented Interfaces:
org.springframework.core.io.InputStreamSource,org.springframework.web.multipart.MultipartFile
public class FileAwareMultipartFile
extends Object
implements org.springframework.web.multipart.MultipartFile
The file aware multipart file.
- Author:
- Christian Bremer
-
Constructor Summary
ConstructorsConstructorDescriptionFileAwareMultipartFile(InputStream inputStream, File tmpDir, String parameterName, String originalFilename, String contentType) Instantiates a new File aware multipart file.FileAwareMultipartFile(InputStream inputStream, String parameterName, String originalFilename, String contentType) Instantiates a new File aware multipart file. -
Method Summary
Modifier and TypeMethodDescriptionstatic FileAwareMultipartFileempty()Empty file aware multipart file.byte[]getBytes()getName()org.springframework.core.io.ResourcelonggetSize()booleanisEmpty()voidtransferTo(File dest) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.web.multipart.MultipartFile
transferTo
-
Constructor Details
-
FileAwareMultipartFile
public FileAwareMultipartFile(InputStream inputStream, String parameterName, String originalFilename, String contentType) throws IOException Instantiates a new File aware multipart file.- Parameters:
inputStream- the input streamparameterName- the parameter nameoriginalFilename- the original filenamecontentType- the content type- Throws:
IOException- the io exception
-
FileAwareMultipartFile
public FileAwareMultipartFile(InputStream inputStream, File tmpDir, String parameterName, String originalFilename, String contentType) throws IOException Instantiates a new File aware multipart file.- Parameters:
inputStream- the input streamtmpDir- the tmp dirparameterName- the parameter nameoriginalFilename- the original filenamecontentType- the content type- Throws:
IOException- the io exception
-
-
Method Details
-
empty
Empty file aware multipart file.- Returns:
- the file aware multipart file
-
getName
- Specified by:
getNamein interfaceorg.springframework.web.multipart.MultipartFile
-
getOriginalFilename
- Specified by:
getOriginalFilenamein interfaceorg.springframework.web.multipart.MultipartFile
-
getContentType
- Specified by:
getContentTypein interfaceorg.springframework.web.multipart.MultipartFile
-
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfaceorg.springframework.web.multipart.MultipartFile
-
getSize
public long getSize()- Specified by:
getSizein interfaceorg.springframework.web.multipart.MultipartFile
-
getBytes
- Specified by:
getBytesin interfaceorg.springframework.web.multipart.MultipartFile- Throws:
IOException
-
getInputStream
- Specified by:
getInputStreamin interfaceorg.springframework.core.io.InputStreamSource- Specified by:
getInputStreamin interfaceorg.springframework.web.multipart.MultipartFile- Throws:
IOException
-
getResource
@NonNull public org.springframework.core.io.Resource getResource()- Specified by:
getResourcein interfaceorg.springframework.web.multipart.MultipartFile
-
transferTo
- Specified by:
transferToin interfaceorg.springframework.web.multipart.MultipartFile- Throws:
IOExceptionIllegalStateException
-