org.apache.struts2.dispatcher.multipart
类 JakartaMultiPartRequest

java.lang.Object
  继承者 org.apache.struts2.dispatcher.multipart.JakartaMultiPartRequest
所有已实现的接口:
MultiPartRequest

public class JakartaMultiPartRequest
extends Object
implements MultiPartRequest

Multipart form data request adapter for Jakarta Commons Fileupload package.


构造方法摘要
JakartaMultiPartRequest()
           
 
方法摘要
 void cleanUp()
          Cleans up all uploaded file, should be called at the end of request
 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).
 void setLocaleProvider(com.opensymphony.xwork2.LocaleProvider provider)
           
 void setMaxSize(String maxSize)
           
 
从类 java.lang.Object 继承的方法
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

构造方法详细信息

JakartaMultiPartRequest

public JakartaMultiPartRequest()
方法详细信息

setMaxSize

public void setMaxSize(String maxSize)

setLocaleProvider

public void setLocaleProvider(com.opensymphony.xwork2.LocaleProvider provider)

parse

public void parse(javax.servlet.http.HttpServletRequest request,
                  String saveDir)
           throws IOException
Creates a new request wrapper to handle multi-part data using methods adapted from Jason Pell's multipart classes (see class description).

指定者:
接口 MultiPartRequest 中的 parse
参数:
saveDir - the directory to save off the file
request - the request containing the multipart
抛出:
IOException - is thrown if encoding fails.

getFileParameterNames

public Enumeration<String> getFileParameterNames()
从接口 MultiPartRequest 复制的描述
Returns an enumeration of the parameter names for uploaded files

指定者:
接口 MultiPartRequest 中的 getFileParameterNames
返回:
an enumeration of the parameter names for uploaded files

getContentType

public String[] getContentType(String fieldName)
从接口 MultiPartRequest 复制的描述
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.

指定者:
接口 MultiPartRequest 中的 getContentType
参数:
fieldName - input field name
返回:
an array of content encoding for the specified input field name or null if no content type was specified.

getFile

public File[] getFile(String fieldName)
从接口 MultiPartRequest 复制的描述
Returns a File object for the filename specified or null if no files are associated with the given field name.

指定者:
接口 MultiPartRequest 中的 getFile
参数:
fieldName - input field name
返回:
a File[] object for files associated with the specified input field name

getFileNames

public String[] getFileNames(String fieldName)
从接口 MultiPartRequest 复制的描述
Returns a String[] of file names for files associated with the specified input field name

指定者:
接口 MultiPartRequest 中的 getFileNames
参数:
fieldName - input field name
返回:
a String[] of file names for files associated with the specified input field name

getFilesystemName

public String[] getFilesystemName(String fieldName)
从接口 MultiPartRequest 复制的描述
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.

指定者:
接口 MultiPartRequest 中的 getFilesystemName
参数:
fieldName - input field name
返回:
the file system name(s) of files associated with the given field name

getParameter

public String getParameter(String name)
从接口 MultiPartRequest 复制的描述
Returns the specified request parameter.

指定者:
接口 MultiPartRequest 中的 getParameter
参数:
name - the name of the parameter to get
返回:
the parameter or null if it was not found.

getParameterNames

public Enumeration<String> getParameterNames()
从接口 MultiPartRequest 复制的描述
Returns an enumeration of String parameter names.

指定者:
接口 MultiPartRequest 中的 getParameterNames
返回:
an enumeration of String parameter names.

getParameterValues

public String[] getParameterValues(String name)
从接口 MultiPartRequest 复制的描述
Returns a list of all parameter values associated with a parameter name. If there is only one parameter value per name the resulting array will be of length 1.

指定者:
接口 MultiPartRequest 中的 getParameterValues
参数:
name - the name of the parameter.
返回:
an array of all values associated with the parameter name.

getErrors

public List<String> getErrors()
从接口 MultiPartRequest 复制的描述
Returns a list of error messages that may have occurred while processing the request. If there are no errors, an empty list is returned. If the underlying implementation (ie: pell, cos, jakarta, etc) cannot support providing these errors, an empty list is also returned. This list of errors is repoted back to the MultiPartRequestWrapper's errors field.

指定者:
接口 MultiPartRequest 中的 getErrors
返回:
a list of Strings that represent various errors during parsing

cleanUp

public void cleanUp()
从接口 MultiPartRequest 复制的描述
Cleans up all uploaded file, should be called at the end of request

指定者:
接口 MultiPartRequest 中的 cleanUp