www.dextsolution.com
DEXTUPLOAD
JK
menu toggleReference > dextuploadjk > support > spring > JKMultipartFile

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

getFieldName

Has the same functionality as the getName method.

See the getFieldName method of the FieldItem interface.

getItemType

See the getItemType method of the FieldItem interface.

isEmpty

See the isEmpty method of the FileItem interface.

getFilename

Has the same functionality as the getOriginalFilename method.

See the getFilename method of the FileItem interface.

getFilenameWithoutExtension

See the getFilenameWithoutExtension method of the FileItem interface.

getContentType

See the getContentType method of the FileItem interface.

getTempFilePath

See the getTempFilePath method of the FileItem interface.

getTempFile

See the getTempFile method of the FileItem interface.

getFileSize

Has the same functionality as the getSize method.

See the getFileSize method of the FileItem interface.

getOriginalFileSize

See the getOriginalFileSize method of the FileItem interface.

isEligibleFile

See the isEligibleFile method of the FileItem interface.

getExtension

See the getExtension method of the FileItem interface.

getLastSavedFilePath

See the getLastSavedFilePath method of the FileItem interface.

getLastRelativeSavedFilePath

See the getLastRelativeSavedFilePath method of the FileItem class.

getLastSavedFilename

See the getLastSavedFilename method of the FileItem interface.

deleteTempFile

See the deleteTempFile method of the FileItem interface.

saveAs

See the saveAs method of the FileItem interface.

save

See the save method of the FileItem interface.

getFileCopyOption

See the getFileCopyOption method of the FileItem interface.

setFileCopyOption

See the setFileCopyOption method of the FileItem interface.

get

See the get method of the FileItem interface.

isCached

See the isCached method of the FileItem interface.

removeCache

See the removeCache method of the FileItem interface.

getEnvironment

See the getEnvironment method of the FileItem interface.

isFiltered

See the isFiltered method of the FileItem interface.