Class DiskFileUpload


  • public class DiskFileUpload
    extends FileUpload
    FileUpload that saves uploaded files directly to destination folder.
    • Field Detail

      • destFolder

        protected final java.io.File destFolder
      • file

        protected java.io.File file
    • Method Detail

      • isInMemory

        public boolean isInMemory()
        Returns false as uploaded file is stored on disk.
        Specified by:
        isInMemory in class FileUpload
      • getDestinationFolder

        public java.io.File getDestinationFolder()
        Returns destination folder.
      • getFile

        public java.io.File getFile()
        Returns uploaded and saved file.
      • getFileContent

        public byte[] getFileContent()
                              throws java.io.IOException
        Returns files content from disk file. If error occurs, it returns null
        Specified by:
        getFileContent in class FileUpload
        Throws:
        java.io.IOException
      • getFileInputStream

        public java.io.InputStream getFileInputStream()
                                               throws java.io.IOException
        Returns new buffered file input stream.
        Specified by:
        getFileInputStream in class FileUpload
        Throws:
        java.io.IOException
      • processStream

        protected void processStream()
                              throws java.io.IOException
        Description copied from class: FileUpload
        Process request input stream. Note that file size is unknown at this point. Therefore, the implementation should set the size attribute after successful processing. This method also must set the valid attribute.
        Specified by:
        processStream in class FileUpload
        Throws:
        java.io.IOException
        See Also:
        MultipartRequestInputStream