Package jodd.http.upload.impl
Class AdaptiveFileUploadFactory
- java.lang.Object
-
- jodd.http.upload.impl.AdaptiveFileUploadFactory
-
- All Implemented Interfaces:
FileUploadFactory
public class AdaptiveFileUploadFactory extends java.lang.Object implements FileUploadFactory
Factory forAdaptiveFileUpload.
-
-
Field Summary
Fields Modifier and Type Field Description protected booleanallowFileExtensionsprotected booleanbreakOnErrorprotected java.lang.String[]fileExtensionsprotected intmaxFileSizeprotected intmemoryThresholdprotected java.io.FileuploadPath
-
Constructor Summary
Constructors Constructor Description AdaptiveFileUploadFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AdaptiveFileUploadFactorybreakOnError(boolean breakOnError)Specifies if upload should break on error.FileUploadcreate(MultipartRequestInputStream input)Creates new instance ofuploaded file.intgetMaxFileSize()intgetMemoryThreshold()java.io.FilegetUploadPath()booleanisBreakOnError()AdaptiveFileUploadFactorysetBreakOnError(boolean breakOnError)AdaptiveFileUploadFactorysetFileExtensions(java.lang.String[] fileExtensions, boolean allow)Allow or disallow set of file extensions.AdaptiveFileUploadFactorysetMaxFileSize(int maxFileSize)Sets maximum file upload size.AdaptiveFileUploadFactorysetMemoryThreshold(int memoryThreshold)Specifies per file memory limit for keeping uploaded files in the memory.AdaptiveFileUploadFactorysetUploadPath(java.io.File uploadPath)Specifies the upload path.
-
-
-
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
-
-
Method Detail
-
create
public FileUpload create(MultipartRequestInputStream input)
Creates new instance ofuploaded file.- Specified by:
createin interfaceFileUploadFactory
-
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 tonulldefault system TEMP path will be used.
-
getMaxFileSize
public int getMaxFileSize()
-
setMaxFileSize
public AdaptiveFileUploadFactory setMaxFileSize(int maxFileSize)
Sets maximum file upload size. Setting to-1disables 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 tonullwill turn this feature off.
-
-