Overview  Package   Class  Tree  Serialized  Deprecated  Index  Help 

com.ibm.wps.portlets.struts.upload
Class WpsCommonsMultipartRequestHandler

java.lang.Object
  extended byorg.apache.struts.upload.CommonsMultipartRequestHandler
      extended bycom.ibm.wps.portlets.struts.upload.WpsCommonsMultipartRequestHandler
All Implemented Interfaces:
com.ibm.portal.struts.upload.IWpsCommonsMultipartRequestHandler, org.apache.struts.upload.MultipartRequestHandler

public class WpsCommonsMultipartRequestHandler
extends org.apache.struts.upload.CommonsMultipartRequestHandler
implements com.ibm.portal.struts.upload.IWpsCommonsMultipartRequestHandler

This is a modified version of the Struts CommonsMultipartRequestHandler that has the DBCS fix for the file name. This request handler will not be needed in future releases of Struts.

Since:
5.1

Field Summary
protected  java.util.Hashtable elementsAll
          The combined text and file request parameters.
protected  java.util.Hashtable elementsFile
          The file request parameters.
protected  java.util.Hashtable elementsText
          The text request parameters.
protected static org.apache.commons.logging.Log log
          The commons-logging instance for this class.
 

Fields inherited from class org.apache.struts.upload.CommonsMultipartRequestHandler
DEFAULT_SIZE_MAX, DEFAULT_SIZE_THRESHOLD
 

Fields inherited from interface org.apache.struts.upload.MultipartRequestHandler
ATTRIBUTE_MAX_LENGTH_EXCEEDED
 

Constructor Summary
WpsCommonsMultipartRequestHandler()
          WpsCommonsMultipartRequestHandler constructor.
 

Method Summary
protected  void addFileParameter(javax.servlet.http.HttpServletRequest request, org.apache.commons.fileupload.FileItem item)
          Adds a file parameter to the set of file parameters for this request and also to the list of all parameters.
protected  void addTextParameter(javax.servlet.http.HttpServletRequest request, org.apache.commons.fileupload.FileItem item)
          Adds a regular text parameter to the set of text parameters for this request and also to the list of all parameters.
 void finish()
          Cleans up at the end of a request.
 java.util.Hashtable getAllElements()
          Returns a hash table containing both text and file request parameters.
 java.util.Hashtable getFileElements()
          Returns a hash table containing the file (that is, non-text) request parameters.
protected  long getSizeFieldThreshold(org.apache.struts.config.ModuleConfig mc)
          Returns the size field threshold which determines whether an uploaded file will be written to disk or cached in memory.
 java.util.Hashtable getTextElements()
          Returns a hash table containing the text (that is, non-file) request parameters.
 void handleRequest(javax.servlet.http.HttpServletRequest request)
          Parses the input stream and partitions the parsed items into a set of form fields and a set of file items.
 void rollback()
          Cleans up when a problem occurs during request processing.
 

Methods inherited from class org.apache.struts.upload.CommonsMultipartRequestHandler
addFileParameter, convertSizeToBytes, getMapping, getRepositoryPath, getServlet, getSizeMax, getSizeThreshold, setMapping, setServlet
 

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
The commons-logging instance for this class.


elementsAll

protected java.util.Hashtable elementsAll
The combined text and file request parameters.


elementsFile

protected java.util.Hashtable elementsFile
The file request parameters.


elementsText

protected java.util.Hashtable elementsText
The text request parameters.

Constructor Detail

WpsCommonsMultipartRequestHandler

public WpsCommonsMultipartRequestHandler()
WpsCommonsMultipartRequestHandler constructor.

Method Detail

handleRequest

public void handleRequest(javax.servlet.http.HttpServletRequest request)
                   throws javax.servlet.ServletException
Parses the input stream and partitions the parsed items into a set of form fields and a set of file items. In the process, the parsed items are translated from Commons FileUpload FileItem instances to Struts FormFile instances.

Specified by:
handleRequest in interface org.apache.struts.upload.MultipartRequestHandler
Parameters:
request - The multipart request to be processed.
Throws:
javax.servlet.ServletException - if an unrecoverable error occurs.

getTextElements

public java.util.Hashtable getTextElements()
Returns a hash table containing the text (that is, non-file) request parameters.

Specified by:
getTextElements in interface org.apache.struts.upload.MultipartRequestHandler
Returns:
The text request parameters.

getFileElements

public java.util.Hashtable getFileElements()
Returns a hash table containing the file (that is, non-text) request parameters.

Specified by:
getFileElements in interface org.apache.struts.upload.MultipartRequestHandler
Returns:
The file request parameters.

getAllElements

public java.util.Hashtable getAllElements()
Returns a hash table containing both text and file request parameters.

Specified by:
getAllElements in interface org.apache.struts.upload.MultipartRequestHandler
Returns:
The text and file request parameters.

rollback

public void rollback()
Cleans up when a problem occurs during request processing.

Specified by:
rollback in interface org.apache.struts.upload.MultipartRequestHandler

finish

public void finish()
Cleans up at the end of a request.

Specified by:
finish in interface org.apache.struts.upload.MultipartRequestHandler

addTextParameter

protected void addTextParameter(javax.servlet.http.HttpServletRequest request,
                                org.apache.commons.fileupload.FileItem item)
Adds a regular text parameter to the set of text parameters for this request and also to the list of all parameters. Handles the case of multiple values for the same parameter by using an array for the parameter value.

Parameters:
request - The request in which the parameter was specified.
item - The file item for the parameter to add.

addFileParameter

protected void addFileParameter(javax.servlet.http.HttpServletRequest request,
                                org.apache.commons.fileupload.FileItem item)
Adds a file parameter to the set of file parameters for this request and also to the list of all parameters.

Parameters:
item - The file item for the parameter to add.

getSizeFieldThreshold

protected long getSizeFieldThreshold(org.apache.struts.config.ModuleConfig mc)
Returns the size field threshold which determines whether an uploaded file will be written to disk or cached in memory.

Parameters:
mc - The current module's configuration.
Returns:
The size threshold, in bytes.

Overview  Package   Class  Tree  Serialized  Deprecated  Index  Help 

 

WebSphere is a trademark of the IBM Corporation in the United States, other countries, or both.

 

IBM is a trademark of the IBM Corporation in the United States, other countries, or both.