Class CommonsMultipartFormDataParser
- java.lang.Object
-
- com.aspectran.web.support.multipart.commons.CommonsMultipartFormDataParser
-
- All Implemented Interfaces:
MultipartFormDataParser
public class CommonsMultipartFormDataParser extends java.lang.Object implements MultipartFormDataParser
Multi-part form data parser that use Apache Commons FileUpload 1.4 or above.
-
-
Constructor Summary
Constructors Constructor Description CommonsMultipartFormDataParser()
Instantiates a new CommonsMultipartFormDataParser.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getTempDirectoryPath()
Returns the directory path used for temporary files.void
parse(RequestAdapter requestAdapter)
Parse the given servlet request, resolving its multipart elements.void
setAllowedFileExtensions(java.lang.String allowedFileExtensions)
Sets the allowed file extensions.void
setDeniedFileExtensions(java.lang.String deniedFileExtensions)
Sets the denied file extensions.void
setMaxFileSize(long maxFileSize)
Set the maximum allowed size (in bytes) for each individual file before an upload gets rejected.void
setMaxInMemorySize(int maxInMemorySize)
Set the maximum allowed size (in bytes) before uploads are written to disk.void
setMaxRequestSize(long maxRequestSize)
Sets the maximum length of HTTP GET Request -1 indicates no limit (the default).void
setTempDirectoryPath(java.lang.String tempDirectoryPath)
Sets the directory path used to temporarily files.
-
-
-
Method Detail
-
getTempDirectoryPath
public java.lang.String getTempDirectoryPath()
Description copied from interface:MultipartFormDataParser
Returns the directory path used for temporary files.- Specified by:
getTempDirectoryPath
in interfaceMultipartFormDataParser
- Returns:
- the directory path used for temporary files
-
setTempDirectoryPath
public void setTempDirectoryPath(java.lang.String tempDirectoryPath)
Description copied from interface:MultipartFormDataParser
Sets the directory path used to temporarily files.- Specified by:
setTempDirectoryPath
in interfaceMultipartFormDataParser
- Parameters:
tempDirectoryPath
- the directory path used for temporary files
-
setMaxRequestSize
public void setMaxRequestSize(long maxRequestSize)
Description copied from interface:MultipartFormDataParser
Sets the maximum length of HTTP GET Request -1 indicates no limit (the default).- Specified by:
setMaxRequestSize
in interfaceMultipartFormDataParser
- Parameters:
maxRequestSize
- the maximum length of HTTP GET Request- See Also:
FileUploadBase.setSizeMax(long)
-
setMaxFileSize
public void setMaxFileSize(long maxFileSize)
Description copied from interface:MultipartFormDataParser
Set the maximum allowed size (in bytes) for each individual file before an upload gets rejected. -1 indicates no limit (the default).- Specified by:
setMaxFileSize
in interfaceMultipartFormDataParser
- Parameters:
maxFileSize
- the maximum upload size per file- See Also:
FileUploadBase.setFileSizeMax(long)
-
setMaxInMemorySize
public void setMaxInMemorySize(int maxInMemorySize)
Description copied from interface:MultipartFormDataParser
Set the maximum allowed size (in bytes) before uploads are written to disk. Uploaded files will still be received past this amount, but they will not be stored in memory. Default is 10240, according to Commons FileUpload.- Specified by:
setMaxInMemorySize
in interfaceMultipartFormDataParser
- Parameters:
maxInMemorySize
- the maximum in memory size allowed- See Also:
DiskFileItemFactory.setSizeThreshold(int)
-
setAllowedFileExtensions
public void setAllowedFileExtensions(java.lang.String allowedFileExtensions)
Description copied from interface:MultipartFormDataParser
Sets the allowed file extensions.- Specified by:
setAllowedFileExtensions
in interfaceMultipartFormDataParser
- Parameters:
allowedFileExtensions
- the allowed file extensions
-
setDeniedFileExtensions
public void setDeniedFileExtensions(java.lang.String deniedFileExtensions)
Description copied from interface:MultipartFormDataParser
Sets the denied file extensions.- Specified by:
setDeniedFileExtensions
in interfaceMultipartFormDataParser
- Parameters:
deniedFileExtensions
- the denied file extensions
-
parse
public void parse(RequestAdapter requestAdapter)
Description copied from interface:MultipartFormDataParser
Parse the given servlet request, resolving its multipart elements.- Specified by:
parse
in interfaceMultipartFormDataParser
- Parameters:
requestAdapter
- the request adapter
-
-