@Intercepts(before=ResourceLookupInterceptor.class, after={}) @RequestScoped public class CommonsUploadMultipartInterceptor extends java.lang.Object implements MultipartInterceptor
Constructor and Description |
---|
CommonsUploadMultipartInterceptor(javax.servlet.http.HttpServletRequest request,
MutableRequest parameters,
MultipartConfig cfg,
Validator validator,
ServletFileUploadCreator fileUploadCreator) |
Modifier and Type | Method and Description |
---|---|
boolean |
accepts(ResourceMethod method)
Will intercept the request if apache file upload says that this request is multipart
|
protected org.apache.commons.fileupload.FileItemFactory |
createFactoryForDiskBasedFileItems(java.io.File temporaryDirectory) |
protected java.lang.String |
fixIndexedParameters(java.lang.String name) |
protected java.lang.String |
getValue(org.apache.commons.fileupload.FileItem item) |
void |
intercept(InterceptorStack stack,
ResourceMethod method,
java.lang.Object instance) |
protected void |
processFile(org.apache.commons.fileupload.FileItem item,
java.lang.String name) |
protected void |
reportSizeLimitExceeded(org.apache.commons.fileupload.FileUploadBase.SizeLimitExceededException e)
This method is called when the
FileUploadBase.SizeLimitExceededException was thrown. |
public CommonsUploadMultipartInterceptor(javax.servlet.http.HttpServletRequest request, MutableRequest parameters, MultipartConfig cfg, Validator validator, ServletFileUploadCreator fileUploadCreator)
public boolean accepts(ResourceMethod method)
accepts
in interface Interceptor
public void intercept(InterceptorStack stack, ResourceMethod method, java.lang.Object instance) throws InterceptionException
intercept
in interface Interceptor
InterceptionException
protected void reportSizeLimitExceeded(org.apache.commons.fileupload.FileUploadBase.SizeLimitExceededException e)
FileUploadBase.SizeLimitExceededException
was thrown. By default, add the key
file.limit.exceeded using Validations
.e
- protected void processFile(org.apache.commons.fileupload.FileItem item, java.lang.String name)
protected org.apache.commons.fileupload.FileItemFactory createFactoryForDiskBasedFileItems(java.io.File temporaryDirectory)
protected java.lang.String getValue(org.apache.commons.fileupload.FileItem item)
protected java.lang.String fixIndexedParameters(java.lang.String name)
Copyright © 2013 Caelum. All Rights Reserved.