Interface FileItem

All Known Implementing Classes:
FormData.FileItemImpl

public interface FileItem
Represents an item of a multipart message for which the filename attribute has been specified
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    If the part represents a file on the file system, delete it, otherwise do nothing
    Gives access to the file stored on the file system.
    long
    The size of the body - works regardless of the result of isInMemory
    The body represented as an InputStream - works regardless of the result of isInMemory
    boolean
    Determines whether the body is held in memory
    void
    write(Path target)
    Copy the body to the specified Path - works regardless of the result of isInMemory
  • Method Details

    • isInMemory

      boolean isInMemory()
      Determines whether the body is held in memory
    • getFile

      Path getFile()
      Gives access to the file stored on the file system. This should only be used when isInMemory is false
    • getFileSize

      long getFileSize() throws IOException
      The size of the body - works regardless of the result of isInMemory
      Throws:
      IOException
    • getInputStream

      InputStream getInputStream() throws IOException
      The body represented as an InputStream - works regardless of the result of isInMemory
      Throws:
      IOException
    • delete

      void delete() throws IOException
      If the part represents a file on the file system, delete it, otherwise do nothing
      Throws:
      IOException
    • write

      void write(Path target) throws IOException
      Copy the body to the specified Path - works regardless of the result of isInMemory
      Throws:
      IOException