org.kuali.rice.kns.web.struts.action
Class KualiMultipartRequestHandler

java.lang.Object
  extended by org.apache.struts.upload.CommonsMultipartRequestHandler
      extended by org.kuali.rice.kns.web.struts.action.KualiMultipartRequestHandler
All Implemented Interfaces:
org.apache.struts.upload.MultipartRequestHandler

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

Subclass of the MultipartRequestHandler used by Struts. This one allows the maximum upload size to be set by the application rather than by an init parameter.

Author:
Kuali Rice Team (rice.collab@kuali.org)

Field Summary
 
Fields inherited from class org.apache.struts.upload.CommonsMultipartRequestHandler
DEFAULT_SIZE_MAX, DEFAULT_SIZE_THRESHOLD, log
 
Fields inherited from interface org.apache.struts.upload.MultipartRequestHandler
ATTRIBUTE_MAX_LENGTH_EXCEEDED
 
Constructor Summary
KualiMultipartRequestHandler()
           
 
Method Summary
 long calculateMaxUploadSizeToMaxOfList(List<String> sizes)
           
 long getSizeMax(org.apache.struts.config.ModuleConfig mc)
          Returns the maximum allowable size, in bytes, of an uploaded file.
 String getSizeMaxString()
           
 void setMaxUploadSizeToMaxOfList(List<String> sizes)
          Sets the max size string to the item in the list that represents the largest size.
 void setSizeMax(String sizeString)
           
 
Methods inherited from class org.apache.struts.upload.CommonsMultipartRequestHandler
addFileParameter, addTextParameter, convertSizeToBytes, finish, getAllElements, getFileElements, getMapping, getRepositoryPath, getServlet, getSizeThreshold, getTextElements, handleRequest, rollback, setMapping, setServlet
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

KualiMultipartRequestHandler

public KualiMultipartRequestHandler()
Method Detail

getSizeMax

public long getSizeMax(org.apache.struts.config.ModuleConfig mc)
Returns the maximum allowable size, in bytes, of an uploaded file. The value is obtained from the current module's controller configuration.

Overrides:
getSizeMax in class org.apache.struts.upload.CommonsMultipartRequestHandler
Parameters:
mc - The current module's configuration.
Returns:
The maximum allowable file size, in bytes.

getSizeMaxString

public String getSizeMaxString()

setSizeMax

public void setSizeMax(String sizeString)

setMaxUploadSizeToMaxOfList

public void setMaxUploadSizeToMaxOfList(List<String> sizes)
Sets the max size string to the item in the list that represents the largest size.


calculateMaxUploadSizeToMaxOfList

public long calculateMaxUploadSizeToMaxOfList(List<String> sizes)


Copyright © 2005-2012 The Kuali Foundation. All Rights Reserved.