HDIV API 2.0.4

org.hdiv.upload
Class HDIVMultipartRequestHandler

java.lang.Object
  extended by org.apache.struts.upload.CommonsMultipartRequestHandler
      extended by org.hdiv.upload.HDIVMultipartRequestHandler
All Implemented Interfaces:
org.apache.struts.upload.MultipartRequestHandler

public class HDIVMultipartRequestHandler
extends org.apache.struts.upload.CommonsMultipartRequestHandler


Field Summary
protected static org.apache.commons.logging.Log log
          Commons Logging instance.
 
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
HDIVMultipartRequestHandler()
           
 
Method Summary
protected  void addFileParameter(java.util.List items)
          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, java.lang.String name, java.lang.String[] value)
          Adds a regular text parameter to the set of text parameters for this request and also to the list of all parameters.
 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.
 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, addTextParameter, convertSizeToBytes, finish, 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
Commons Logging instance.

Constructor Detail

HDIVMultipartRequestHandler

public HDIVMultipartRequestHandler()
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
Overrides:
handleRequest in class org.apache.struts.upload.CommonsMultipartRequestHandler
Parameters:
request - The multipart request to be processed.
Throws:
javax.servlet.ServletException - if an unrecoverable error occurs.

addTextParameter

protected void addTextParameter(javax.servlet.http.HttpServletRequest request,
                                java.lang.String name,
                                java.lang.String[] value)
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(java.util.List items)
Adds a file parameter to the set of file parameters for this request and also to the list of all parameters.

Parameters:
items - file items for the parameter to add

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
Overrides:
getTextElements in class org.apache.struts.upload.CommonsMultipartRequestHandler
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
Overrides:
getFileElements in class org.apache.struts.upload.CommonsMultipartRequestHandler
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
Overrides:
getAllElements in class org.apache.struts.upload.CommonsMultipartRequestHandler
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
Overrides:
rollback in class org.apache.struts.upload.CommonsMultipartRequestHandler

HDIV 2.0.4

Copyright © 2008 hdiv.org. All Rights Reserved.