dextuploadjk.support.spring
Class JKMultipartFile
- Minimum version
- 1.0.0
- Minimum environment
- Java 17, Spring Framework 6.0.14, Spring Boot 3.0.12
- Description
-
It is a class that holds uploaded temporary file information and is used in the Spring Web Framework environment.
The JKMultipartFile class is a class that implements the FileItem interface and the org.springframework.web.multipart.MultipartFile interface.
- Constructor
-
JKMultipartFile
-
Create an object of class JKMultipartFile.
-
Signatures
public JKMultipartFile(FileItem item)
-
Parameters
Name Type Description item dextuploadjk.FileItem FileItem object
-
- Methods
-
getName
-
Returns the field names of the multipart element.
-
Signatures
public String getName()
-
Return
Field names of the multipart element
getOriginalFilename
-
Returns the filename.
-
Signatures
public String getOriginalFilename()
-
Return
File name
getSize
-
Returns the size of the filename.
-
Signatures
public long getSize()
-
Return
Filename size
getBytes
-
Returns the contents of the file as a byte array.
-
Signatures
public byte[] getBytes()
-
Return
The byte array
getInputStream
-
Returns a java.io.InputStream object so that the contents of the file can be read.
-
Signatures
public InputStream getInputStream()
-
Return
java.io.InputStream object
transferTo
-
Save the temporary file to the given destination file.
This method is defined in the org.springframework.web.multipart.MultipartFile interface. It is recommended to use the save method instead of this method.
Note) If the target file already exists, overwrite (delete and copy) will be performed.
-
Signatures
public void transferTo(File dest)
-
Parameters
Name Type Description dest java.io.File Target file
Has the same functionality as the getName method.
See the getFieldName method of the FieldItem interface.
See the getItemType method of the FieldItem interface.
See the isEmpty method of the FileItem interface.
Has the same functionality as the getOriginalFilename method.
See the getFilename method of the FileItem interface.
See the getFilenameWithoutExtension method of the FileItem interface.
See the getContentType method of the FileItem interface.
See the getTempFilePath method of the FileItem interface.
See the getTempFile method of the FileItem interface.
Has the same functionality as the getSize method.
See the getFileSize method of the FileItem interface.
See the getOriginalFileSize method of the FileItem interface.
See the isEligibleFile method of the FileItem interface.
See the getExtension method of the FileItem interface.
See the getLastSavedFilePath method of the FileItem interface.
See the getLastRelativeSavedFilePath method of the FileItem class.
See the getLastSavedFilename method of the FileItem interface.
See the deleteTempFile method of the FileItem interface.
See the saveAs method of the FileItem interface.
See the save method of the FileItem interface.
See the getFileCopyOption method of the FileItem interface.
See the setFileCopyOption method of the FileItem interface.
See the get method of the FileItem interface.
See the isCached method of the FileItem interface.
See the removeCache method of the FileItem interface.
See the getEnvironment method of the FileItem interface.
See the isFiltered method of the FileItem interface.
-