Class MultipartDecoderImpl
- java.lang.Object
-
- org.apache.tapestry5.upload.internal.services.MultipartDecoderImpl
-
- All Implemented Interfaces:
EventListener,ThreadCleanupListener,MultipartDecoder
public class MultipartDecoderImpl extends Object implements MultipartDecoder, ThreadCleanupListener
Implementation of multipart decoder for servlets. This implementation is perthread scope.
-
-
Constructor Summary
Constructors Constructor Description MultipartDecoderImpl(org.apache.commons.fileupload.FileItemFactory fileItemFactory, long maxRequestSize, long maxFileSize, String requestEncoding)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddUploadedFile(String name, UploadedFileItem file)protected org.apache.commons.fileupload.servlet.ServletFileUploadcreateFileUpload()HttpServletRequestdecode(HttpServletRequest request)Decodes the request, returning a newHttpServletRequestimplementation that will allow access to the form fields submitted in the request (but omits uploaded files).UploadedFilegetFileUpload(String parameterName)org.apache.commons.fileupload.FileUploadExceptiongetUploadException()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(HttpServletRequest request)protected HttpServletRequestprocessFileItems(HttpServletRequest request, List<org.apache.commons.fileupload.FileItem> fileItems)voidthreadDidCleanup()Invoked byPerthreadManagerservice when a thread performs and end-of-request cleanup.
-
-
-
Constructor Detail
-
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 Detail
-
getFileUpload
public UploadedFile getFileUpload(String parameterName)
- Specified by:
getFileUploadin 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
public HttpServletRequest decode(HttpServletRequest request)
Description copied from interface:MultipartDecoderDecodes the request, returning a newHttpServletRequestimplementation that will allow access to the form fields submitted in the request (but omits uploaded files).- Specified by:
decodein interfaceMultipartDecoder- Parameters:
request- The incoming servlet request- Returns:
- decoded http request
-
threadDidCleanup
public void threadDidCleanup()
Description copied from interface:ThreadCleanupListenerInvoked byPerthreadManagerservice when a thread performs and end-of-request cleanup.- Specified by:
threadDidCleanupin interfaceThreadCleanupListener
-
parseRequest
protected List<org.apache.commons.fileupload.FileItem> parseRequest(HttpServletRequest request)
-
createFileUpload
protected org.apache.commons.fileupload.servlet.ServletFileUpload createFileUpload()
-
processFileItems
protected HttpServletRequest processFileItems(HttpServletRequest request, List<org.apache.commons.fileupload.FileItem> fileItems)
-
addUploadedFile
protected void addUploadedFile(String name, UploadedFileItem file)
-
getUploadException
public org.apache.commons.fileupload.FileUploadException getUploadException()
Description copied from interface:MultipartDecoderReturns the exception the occured during the file upload, or null if the processing of the multipart upload stream was succesful.- Specified by:
getUploadExceptionin interfaceMultipartDecoder
-
-