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

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void delete()
      If the part represents a file on the file system, delete it, otherwise do nothing
      Path getFile()
      Gives access to the file stored on the file system.
      long getFileSize()
      The size of the body - works regardless of the result of isInMemory
      InputStream getInputStream()
      The body represented as an InputStream - works regardless of the result of isInMemory
      boolean isInMemory()
      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 Detail

      • 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
      • 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