Class FormData.FileItemImpl

    • Constructor Detail

      • FileItemImpl

        public FileItemImpl​(Path file)
      • FileItemImpl

        public FileItemImpl​(byte[] content)
    • Method Detail

      • isInMemory

        public boolean isInMemory()
        Description copied from interface: FileItem
        Determines whether the body is held in memory
        Specified by:
        isInMemory in interface FileItem
      • getFile

        public Path getFile()
        Description copied from interface: FileItem
        Gives access to the file stored on the file system. This should only be used when isInMemory is false
        Specified by:
        getFile in interface FileItem
      • delete

        public void delete()
                    throws IOException
        Description copied from interface: FileItem
        If the part represents a file on the file system, delete it, otherwise do nothing
        Specified by:
        delete in interface FileItem
        Throws:
        IOException
      • write

        public void write​(Path target)
                   throws IOException
        Description copied from interface: FileItem
        Copy the body to the specified Path - works regardless of the result of isInMemory
        Specified by:
        write in interface FileItem
        Throws:
        IOException