com.opensymphony.webwork.dispatcher.multipart
Class MultiPartRequest

java.lang.Object
  extended by com.opensymphony.webwork.dispatcher.multipart.MultiPartRequest
Direct Known Subclasses:
JakartaMultiPartRequest, PellMultiPartRequest

public abstract class MultiPartRequest
extends Object

Abstract wrapper class HTTP requests to handle multi-part data.

Author:
Matt Baldree, Patrick Lightbody, Bill Lynch (docs)

Field Summary
protected static org.apache.commons.logging.Log log
           
 
Constructor Summary
MultiPartRequest()
           
 
Method Summary
abstract  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.
abstract  List getErrors()
          Returns a list of error messages that may have occurred while processing the request.
abstract  File[] getFile(String fieldName)
          Returns a File object for the filename specified or null if no files are associated with the given field name.
abstract  String[] getFileNames(String fieldName)
          Returns a String[] of file names for files associated with the specified input field name
abstract  Enumeration getFileParameterNames()
          Returns an enumeration of the parameter names for uploaded files
abstract  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.
abstract  String getParameter(String name)
          Returns the specified request parameter.
abstract  Enumeration getParameterNames()
          Returns an enumeration of String parameter names.
abstract  String[] getParameterValues(String name)
          Returns a list of all parameter values associated with a parameter name.
static boolean isMultiPart(HttpServletRequest request)
          Returns true if the request is multipart form data, false otherwise.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected static org.apache.commons.logging.Log log
Constructor Detail

MultiPartRequest

public MultiPartRequest()
Method Detail

isMultiPart

public static boolean isMultiPart(HttpServletRequest request)
Returns true if the request is multipart form data, false otherwise.

Parameters:
request - the http servlet request.
Returns:
true if the request is multipart form data, false otherwise.

getFileParameterNames

public abstract Enumeration getFileParameterNames()
Returns an enumeration of the parameter names for uploaded files

Returns:
an enumeration of the parameter names for uploaded files

getContentType

public abstract 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.

Parameters:
fieldName - input field name
Returns:
an array of content encoding for the specified input field name or null if no content type was specified.

getFile

public abstract File[] getFile(String fieldName)
Returns a File object for the filename specified or null if no files are associated with the given field name.

Parameters:
fieldName - input field name
Returns:
a File[] object for files associated with the specified input field name

getFileNames

public abstract String[] getFileNames(String fieldName)
Returns a String[] of file names for files associated with the specified input field name

Parameters:
fieldName - input field name
Returns:
a String[] of file names for files associated with the specified input field name

getFilesystemName

public abstract 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.

Parameters:
fieldName - input field name
Returns:
the file system name(s) of files associated with the given field name

getParameter

public abstract String getParameter(String name)
Returns the specified request parameter.

Parameters:
name - the name of the parameter to get
Returns:
the parameter or null if it was not found.

getParameterNames

public abstract Enumeration getParameterNames()
Returns an enumeration of String parameter names.

Returns:
an enumeration of String parameter names.

getParameterValues

public abstract String[] getParameterValues(String name)
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.

Parameters:
name - the name of the parameter.
Returns:
an array of all values associated with the parameter name.

getErrors

public abstract List getErrors()
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.

Returns:
a list of Strings that represent various errors during parsing

WebWork Project Page