Class StandardMultipartFile

java.lang.Object
cn.sinozg.applet.common.suport.StandardMultipartFile
All Implemented Interfaces:
Serializable, org.springframework.core.io.InputStreamSource, org.springframework.web.multipart.MultipartFile

public class StandardMultipartFile extends Object implements org.springframework.web.multipart.MultipartFile, Serializable
Spring MultipartFile adapter, wrapping a Servlet Part object.
Since:
2024-07-15 22:01
Author:
xyb
See Also:
  • Field Details

    • fileItem

      private final org.apache.commons.fileupload2.core.DiskFileItem fileItem
    • filename

      private final String filename
  • Constructor Details

    • StandardMultipartFile

      public StandardMultipartFile(org.apache.commons.fileupload2.core.DiskFileItem fileItem, String filename)
  • Method Details

    • getName

      @NotNull public @NotNull String getName()
      Specified by:
      getName in interface org.springframework.web.multipart.MultipartFile
    • getOriginalFilename

      public String getOriginalFilename()
      Specified by:
      getOriginalFilename in interface org.springframework.web.multipart.MultipartFile
    • getContentType

      public String getContentType()
      Specified by:
      getContentType in interface org.springframework.web.multipart.MultipartFile
    • isEmpty

      public boolean isEmpty()
      Specified by:
      isEmpty in interface org.springframework.web.multipart.MultipartFile
    • getSize

      public long getSize()
      Specified by:
      getSize in interface org.springframework.web.multipart.MultipartFile
    • getBytes

      public byte @NotNull [] getBytes() throws IOException
      Specified by:
      getBytes in interface org.springframework.web.multipart.MultipartFile
      Throws:
      IOException
    • getInputStream

      @NotNull public @NotNull InputStream getInputStream() throws IOException
      Specified by:
      getInputStream in interface org.springframework.core.io.InputStreamSource
      Specified by:
      getInputStream in interface org.springframework.web.multipart.MultipartFile
      Throws:
      IOException
    • transferTo

      public void transferTo(File dest) throws IOException, IllegalStateException
      Specified by:
      transferTo in interface org.springframework.web.multipart.MultipartFile
      Throws:
      IOException
      IllegalStateException
    • transferTo

      public void transferTo(@NotNull @NotNull Path dest) throws IOException, IllegalStateException
      Specified by:
      transferTo in interface org.springframework.web.multipart.MultipartFile
      Throws:
      IOException
      IllegalStateException