public class JakartaMultiPartRequest extends Object implements MultiPartRequest
| Modifier and Type | Field and Description |
|---|---|
protected List<String> |
errors |
protected Map<String,List<org.apache.commons.fileupload.FileItem>> |
files |
protected long |
maxSize |
protected Map<String,List<String>> |
params |
| Constructor and Description |
|---|
JakartaMultiPartRequest() |
| Modifier and Type | Method and Description |
|---|---|
protected String |
buildErrorMessage(Throwable e,
Object[] args) |
void |
cleanUp()
Cleans up all uploaded file, should be called at the end of request
|
protected org.apache.commons.fileupload.disk.DiskFileItemFactory |
createDiskFileItemFactory(String saveDir) |
protected org.apache.commons.fileupload.RequestContext |
createRequestContext(javax.servlet.http.HttpServletRequest req)
Creates a RequestContext needed by Jakarta Commons Upload.
|
protected org.apache.commons.fileupload.servlet.ServletFileUpload |
createServletFileUpload(org.apache.commons.fileupload.disk.DiskFileItemFactory fac) |
String[] |
getContentType(String fieldName)
Returns the content type(s) of the file(s) associated with the specified field name
(as supplied by the client browser), or null if no files are associated with the
given field name.
|
List<String> |
getErrors()
Returns a list of error messages that may have occurred while processing the request.
|
File[] |
getFile(String fieldName)
Returns a
File object for the filename specified or null if no files
are associated with the given field name. |
String[] |
getFileNames(String fieldName)
Returns a String[] of file names for files associated with the specified input field name
|
Enumeration<String> |
getFileParameterNames()
Returns an enumeration of the parameter names for uploaded files
|
String[] |
getFilesystemName(String fieldName)
Returns the file system name(s) of files associated with the given field name or
null if no files are associated with the given field name.
|
String |
getParameter(String name)
Returns the specified request parameter.
|
Enumeration<String> |
getParameterNames()
Returns an enumeration of String parameter names.
|
String[] |
getParameterValues(String name)
Returns a list of all parameter values associated with a parameter name.
|
void |
parse(javax.servlet.http.HttpServletRequest request,
String saveDir)
Creates a new request wrapper to handle multi-part data using methods adapted from Jason Pell's
multipart classes (see class description).
|
protected List<org.apache.commons.fileupload.FileItem> |
parseRequest(javax.servlet.http.HttpServletRequest servletRequest,
String saveDir) |
protected void |
processFileField(org.apache.commons.fileupload.FileItem item) |
protected void |
processNormalFormField(org.apache.commons.fileupload.FileItem item,
String charset) |
protected void |
processUpload(javax.servlet.http.HttpServletRequest request,
String saveDir) |
protected void |
setLocale(javax.servlet.http.HttpServletRequest request) |
void |
setLocaleProvider(LocaleProvider provider) |
void |
setMaxSize(String maxSize) |
public void setMaxSize(String maxSize)
public void setLocaleProvider(LocaleProvider provider)
public void parse(javax.servlet.http.HttpServletRequest request,
String saveDir)
throws IOException
parse in interface MultiPartRequestsaveDir - the directory to save off the filerequest - the request containing the multipartIOException - is thrown if encoding fails.protected void setLocale(javax.servlet.http.HttpServletRequest request)
protected void processUpload(javax.servlet.http.HttpServletRequest request,
String saveDir)
throws org.apache.commons.fileupload.FileUploadException,
UnsupportedEncodingException
org.apache.commons.fileupload.FileUploadExceptionUnsupportedEncodingExceptionprotected void processFileField(org.apache.commons.fileupload.FileItem item)
protected void processNormalFormField(org.apache.commons.fileupload.FileItem item,
String charset)
throws UnsupportedEncodingException
UnsupportedEncodingExceptionprotected List<org.apache.commons.fileupload.FileItem> parseRequest(javax.servlet.http.HttpServletRequest servletRequest, String saveDir) throws org.apache.commons.fileupload.FileUploadException
org.apache.commons.fileupload.FileUploadExceptionprotected org.apache.commons.fileupload.servlet.ServletFileUpload createServletFileUpload(org.apache.commons.fileupload.disk.DiskFileItemFactory fac)
protected org.apache.commons.fileupload.disk.DiskFileItemFactory createDiskFileItemFactory(String saveDir)
public Enumeration<String> getFileParameterNames()
MultiPartRequestgetFileParameterNames in interface MultiPartRequestpublic String[] getContentType(String fieldName)
MultiPartRequestgetContentType in interface MultiPartRequestfieldName - input field namepublic File[] getFile(String fieldName)
MultiPartRequestFile object for the filename specified or null if no files
are associated with the given field name.getFile in interface MultiPartRequestfieldName - input field namepublic String[] getFileNames(String fieldName)
MultiPartRequestgetFileNames in interface MultiPartRequestfieldName - input field namepublic String[] getFilesystemName(String fieldName)
MultiPartRequestgetFilesystemName in interface MultiPartRequestfieldName - input field namepublic String getParameter(String name)
MultiPartRequestgetParameter in interface MultiPartRequestname - the name of the parameter to getpublic Enumeration<String> getParameterNames()
MultiPartRequestgetParameterNames in interface MultiPartRequestpublic String[] getParameterValues(String name)
MultiPartRequestgetParameterValues in interface MultiPartRequestname - the name of the parameter.public List<String> getErrors()
MultiPartRequestMultiPartRequestWrapper's errors field.getErrors in interface MultiPartRequestprotected org.apache.commons.fileupload.RequestContext createRequestContext(javax.servlet.http.HttpServletRequest req)
req - the request.public void cleanUp()
MultiPartRequestcleanUp in interface MultiPartRequestCopyright © 2000–2016 Apache Software Foundation. All rights reserved.