Class MultipartDecoderImpl
java.lang.Object
org.apache.tapestry5.upload.internal.services.MultipartDecoderImpl
- All Implemented Interfaces:
EventListener
,ThreadCleanupListener
,MultipartDecoder
Implementation of multipart decoder for servlets. This implementation is perthread scope.
-
Constructor Summary
ConstructorsConstructorDescriptionMultipartDecoderImpl
(org.apache.commons.fileupload.FileItemFactory fileItemFactory, long maxRequestSize, long maxFileSize, String requestEncoding) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
addUploadedFile
(String name, UploadedFileItem file) protected org.apache.commons.fileupload.servlet.ServletFileUpload
javax.servlet.http.HttpServletRequest
decode
(javax.servlet.http.HttpServletRequest request) Decodes the request, returning a newHttpServletRequest
implementation that will allow access to the form fields submitted in the request (but omits uploaded files).getFileUpload
(String parameterName) org.apache.commons.fileupload.FileUploadException
Returns the exception the occured during the file upload, or null if the processing of the multipart upload stream was succesful.protected List<org.apache.commons.fileupload.FileItem>
parseRequest
(javax.servlet.http.HttpServletRequest request) protected javax.servlet.http.HttpServletRequest
processFileItems
(javax.servlet.http.HttpServletRequest request, List<org.apache.commons.fileupload.FileItem> fileItems) void
Invoked byPerthreadManager
service when a thread performs and end-of-request cleanup.
-
Constructor Details
-
MultipartDecoderImpl
public MultipartDecoderImpl(org.apache.commons.fileupload.FileItemFactory fileItemFactory, @Symbol("upload.requestsize-max") long maxRequestSize, @Symbol("upload.filesize-max") long maxFileSize, @Symbol("tapestry.charset") String requestEncoding)
-
-
Method Details
-
getFileUpload
- Specified by:
getFileUpload
in interfaceMultipartDecoder
- Parameters:
parameterName
- Name of the query parameter associated with the uploaded file- Returns:
- a file upload with the given name, or null if no such file upload was in the request.
-
decode
Description copied from interface:MultipartDecoder
Decodes the request, returning a newHttpServletRequest
implementation that will allow access to the form fields submitted in the request (but omits uploaded files).- Specified by:
decode
in interfaceMultipartDecoder
- Parameters:
request
- The incoming servlet request- Returns:
- decoded http request
-
threadDidCleanup
Description copied from interface:ThreadCleanupListener
Invoked byPerthreadManager
service when a thread performs and end-of-request cleanup.- Specified by:
threadDidCleanup
in interfaceThreadCleanupListener
-
parseRequest
protected List<org.apache.commons.fileupload.FileItem> parseRequest(javax.servlet.http.HttpServletRequest request) -
createFileUpload
-
processFileItems
protected javax.servlet.http.HttpServletRequest processFileItems(javax.servlet.http.HttpServletRequest request, List<org.apache.commons.fileupload.FileItem> fileItems) -
addUploadedFile
-
getUploadException
Description copied from interface:MultipartDecoder
Returns the exception the occured during the file upload, or null if the processing of the multipart upload stream was succesful.- Specified by:
getUploadException
in interfaceMultipartDecoder
-