|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.struts2.dispatcher.multipart.JakartaMultiPartRequest
public class JakartaMultiPartRequest
Multipart form data request adapter for Jakarta Commons Fileupload package.
Field Summary | |
---|---|
private List<String> |
errors
|
private Map<String,List<org.apache.commons.fileupload.FileItem>> |
files
|
(package private) static Logger |
LOG
|
private long |
maxSize
|
private Map<String,List<String>> |
params
|
Constructor Summary | |
---|---|
JakartaMultiPartRequest()
|
Method Summary | |
---|---|
private org.apache.commons.fileupload.RequestContext |
createRequestContext(HttpServletRequest req)
Creates a RequestContext needed by Jakarta Commons Upload. |
private String |
getCanonicalName(String filename)
Returns the canonical name of the given file. |
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 |
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(HttpServletRequest servletRequest,
String saveDir)
Creates a new request wrapper to handle multi-part data using methods adapted from Jason Pell's multipart classes (see class description). |
void |
setMaxSize(String maxSize)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
static final Logger LOG
private Map<String,List<org.apache.commons.fileupload.FileItem>> files
private Map<String,List<String>> params
private List<String> errors
private long maxSize
Constructor Detail |
---|
public JakartaMultiPartRequest()
Method Detail |
---|
public void setMaxSize(String maxSize)
public void parse(HttpServletRequest servletRequest, String saveDir) throws IOException
parse
in interface MultiPartRequest
saveDir
- the directory to save off the fileservletRequest
- the request containing the multipart
IOException
- is thrown if encoding fails.public Enumeration<String> getFileParameterNames()
MultiPartRequest
getFileParameterNames
in interface MultiPartRequest
public String[] getContentType(String fieldName)
MultiPartRequest
getContentType
in interface MultiPartRequest
fieldName
- input field name
public File[] getFile(String fieldName)
MultiPartRequest
File
object for the filename specified or null if no files
are associated with the given field name.
getFile
in interface MultiPartRequest
fieldName
- input field name
public String[] getFileNames(String fieldName)
MultiPartRequest
getFileNames
in interface MultiPartRequest
fieldName
- input field name
public String[] getFilesystemName(String fieldName)
MultiPartRequest
getFilesystemName
in interface MultiPartRequest
fieldName
- input field name
public String getParameter(String name)
MultiPartRequest
getParameter
in interface MultiPartRequest
name
- the name of the parameter to get
public Enumeration<String> getParameterNames()
MultiPartRequest
getParameterNames
in interface MultiPartRequest
public String[] getParameterValues(String name)
MultiPartRequest
getParameterValues
in interface MultiPartRequest
name
- the name of the parameter.
public List getErrors()
MultiPartRequest
MultiPartRequestWrapper
's errors field.
getErrors
in interface MultiPartRequest
private String getCanonicalName(String filename)
filename
- the given file
private org.apache.commons.fileupload.RequestContext createRequestContext(HttpServletRequest req)
req
- the request.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |