jodd.servlet.upload.impl
Class AdaptiveFileUploadFactory

java.lang.Object
  extended by jodd.servlet.upload.impl.AdaptiveFileUploadFactory
All Implemented Interfaces:
FileUploadFactory

public class AdaptiveFileUploadFactory
extends java.lang.Object
implements FileUploadFactory

Factory for AdaptiveFileUpload.


Field Summary
protected  boolean allowFileExtensions
           
protected  boolean breakOnError
           
protected  java.lang.String[] fileExtensions
           
protected  int maxFileSize
           
protected  int memoryThreshold
           
protected  java.io.File uploadPath
           
 
Constructor Summary
AdaptiveFileUploadFactory()
           
 
Method Summary
 AdaptiveFileUploadFactory breakOnError(boolean breakOnError)
          Specifies if upload should break on error.
 FileUpload create(MultipartRequestInputStream input)
          Creates new instance of uploaded file.
 int getMaxFileSize()
           
 int getMemoryThreshold()
           
 java.io.File getUploadPath()
           
 boolean isBreakOnError()
           
 AdaptiveFileUploadFactory setBreakOnError(boolean breakOnError)
           
 AdaptiveFileUploadFactory setFileExtensions(java.lang.String[] fileExtensions, boolean allow)
          Allow or disallow set of file extensions.
 AdaptiveFileUploadFactory setMaxFileSize(int maxFileSize)
          Sets maximum file upload size.
 AdaptiveFileUploadFactory setMemoryThreshold(int memoryThreshold)
          Specifies per file memory limit for keeping uploaded files in the memory.
 AdaptiveFileUploadFactory setUploadPath(java.io.File uploadPath)
          Specifies the upload path.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

memoryThreshold

protected int memoryThreshold

uploadPath

protected java.io.File uploadPath

maxFileSize

protected int maxFileSize

breakOnError

protected boolean breakOnError

fileExtensions

protected java.lang.String[] fileExtensions

allowFileExtensions

protected boolean allowFileExtensions
Constructor Detail

AdaptiveFileUploadFactory

public AdaptiveFileUploadFactory()
Method Detail

create

public FileUpload create(MultipartRequestInputStream input)
Creates new instance of uploaded file.

Specified by:
create in interface FileUploadFactory

getMemoryThreshold

public int getMemoryThreshold()

setMemoryThreshold

public AdaptiveFileUploadFactory setMemoryThreshold(int memoryThreshold)
Specifies per file memory limit for keeping uploaded files in the memory.


getUploadPath

public java.io.File getUploadPath()

setUploadPath

public AdaptiveFileUploadFactory setUploadPath(java.io.File uploadPath)
Specifies the upload path. If set to null default system TEMP path will be used.


getMaxFileSize

public int getMaxFileSize()

setMaxFileSize

public AdaptiveFileUploadFactory setMaxFileSize(int maxFileSize)
Sets maximum file upload size. Setting to -1 disables this constraint.


isBreakOnError

public boolean isBreakOnError()

setBreakOnError

public AdaptiveFileUploadFactory setBreakOnError(boolean breakOnError)

breakOnError

public AdaptiveFileUploadFactory breakOnError(boolean breakOnError)
Specifies if upload should break on error.


setFileExtensions

public AdaptiveFileUploadFactory setFileExtensions(java.lang.String[] fileExtensions,
                                                   boolean allow)
Allow or disallow set of file extensions. Only one rule can be active at time, which means user can only specify extensions that are either allowed or disallowed. Setting this value to null will turn this feature off.



Copyright © 2003-2012 Jodd Team