Class InMemoryMultipartFormDataParser
- java.lang.Object
-
- com.aspectran.web.support.multipart.inmemory.InMemoryMultipartFormDataParser
-
- All Implemented Interfaces:
MultipartFormDataParser
public class InMemoryMultipartFormDataParser extends java.lang.Object implements MultipartFormDataParser
Multi-part form data parser that use Apache Commons FileUpload 1.3 or above.It is designed to store uploaded data items in memory, such as GAE, where the file system is not available.
-
-
Constructor Summary
Constructors Constructor Description InMemoryMultipartFormDataParser()Instantiates a new InMemoryMultipartFormDataParser.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetTempDirectoryPath()Returns the directory path used for temporary files.voidparse(com.aspectran.core.adapter.RequestAdapter requestAdapter)Parse the given servlet request, resolving its multipart elements.voidsetAllowedFileExtensions(java.lang.String allowedFileExtensions)Sets the allowed file extensions.voidsetDeniedFileExtensions(java.lang.String deniedFileExtensions)Sets the denied file extensions.voidsetMaxFileSize(long maxFileSize)Set the maximum allowed size (in bytes) for each individual file before an upload gets rejected.voidsetMaxInMemorySize(int maxInMemorySize)Set the maximum allowed size (in bytes) before uploads are written to disk.voidsetMaxRequestSize(long maxRequestSize)Sets the maximum length of HTTP GET Request -1 indicates no limit (the default).voidsetTempDirectoryPath(java.lang.String tempDirectoryPath)Sets the directory path used to temporarily files.
-
-
-
Method Detail
-
getTempDirectoryPath
public java.lang.String getTempDirectoryPath()
Description copied from interface:MultipartFormDataParserReturns the directory path used for temporary files.- Specified by:
getTempDirectoryPathin interfaceMultipartFormDataParser- Returns:
- the directory path used for temporary files
-
setTempDirectoryPath
public void setTempDirectoryPath(java.lang.String tempDirectoryPath)
Description copied from interface:MultipartFormDataParserSets the directory path used to temporarily files.- Specified by:
setTempDirectoryPathin interfaceMultipartFormDataParser- Parameters:
tempDirectoryPath- the directory path used for temporary files
-
setMaxRequestSize
public void setMaxRequestSize(long maxRequestSize)
Description copied from interface:MultipartFormDataParserSets the maximum length of HTTP GET Request -1 indicates no limit (the default).- Specified by:
setMaxRequestSizein 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:MultipartFormDataParserSet the maximum allowed size (in bytes) for each individual file before an upload gets rejected. -1 indicates no limit (the default).- Specified by:
setMaxFileSizein interfaceMultipartFormDataParser- Parameters:
maxFileSize- the maximum upload size per file- See Also:
FileUploadBase.setFileSizeMax(long)
-
setMaxInMemorySize
public void setMaxInMemorySize(int maxInMemorySize)
Description copied from interface:MultipartFormDataParserSet 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:
setMaxInMemorySizein 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:MultipartFormDataParserSets the allowed file extensions.- Specified by:
setAllowedFileExtensionsin interfaceMultipartFormDataParser- Parameters:
allowedFileExtensions- the allowed file extensions
-
setDeniedFileExtensions
public void setDeniedFileExtensions(java.lang.String deniedFileExtensions)
Description copied from interface:MultipartFormDataParserSets the denied file extensions.- Specified by:
setDeniedFileExtensionsin interfaceMultipartFormDataParser- Parameters:
deniedFileExtensions- the denied file extensions
-
parse
public void parse(com.aspectran.core.adapter.RequestAdapter requestAdapter) throws MultipartRequestParseExceptionDescription copied from interface:MultipartFormDataParserParse the given servlet request, resolving its multipart elements.- Specified by:
parsein interfaceMultipartFormDataParser- Parameters:
requestAdapter- the request adapter- Throws:
MultipartRequestParseException- if multipart resolution failed
-
-