jodd.servlet.upload.impl
Class DiskFileUpload

java.lang.Object
  extended by jodd.servlet.upload.FileUpload
      extended by jodd.servlet.upload.impl.DiskFileUpload

public class DiskFileUpload
extends FileUpload

FileUpload that saves uploaded files directly to destination folder.


Field Summary
protected  java.io.File destFolder
           
protected  java.io.File file
           
 
Fields inherited from class jodd.servlet.upload.FileUpload
fileTooBig, header, input, maxFileSize, size, valid
 
Method Summary
 java.io.File getDestinationFolder()
          Returns destination folder.
 java.io.File getFile()
          Returns uploaded and saved file.
 byte[] getFileContent()
          Returns files content from disk file.
 java.io.InputStream getFileInputStream()
          Returns new buffered file input stream.
 boolean isInMemory()
          Returns false as uploaded file is stored on disk.
protected  void processStream()
          Process request input stream.
 
Methods inherited from class jodd.servlet.upload.FileUpload
getHeader, getMaxFileSize, getSize, isFileTooBig, isUploaded, isValid, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

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


Copyright © 2003-2012 Jodd Team