HDIV API 2.0.4

org.hdiv.config.multipart
Class StrutsMultipartConfig

java.lang.Object
  extended by org.hdiv.config.multipart.AbstractMultipartConfig
      extended by org.hdiv.config.multipart.StrutsMultipartConfig
All Implemented Interfaces:
IMultipartConfig

public class StrutsMultipartConfig
extends AbstractMultipartConfig

Class containing multipart request configuration and methods initialized from Spring Factory.

Author:
Gorka Vicente

Field Summary
protected  java.lang.String memFileSize
          The size threshold which determines whether an uploaded file will be written to disk or cached in memory.
 
Fields inherited from class org.hdiv.config.multipart.AbstractMultipartConfig
maxFileSize, tempDir
 
Fields inherited from interface org.hdiv.config.multipart.IMultipartConfig
ATTRIBUTE_MAX_LENGTH_EXCEEDED, DEFAULT_SIZE_MAX, DEFAULT_SIZE_THRESHOLD, FILEUPLOAD_EXCEPTION
 
Constructor Summary
StrutsMultipartConfig()
           
 
Method Summary
 void addTextParameter(RequestWrapper request, org.apache.commons.fileupload.FileItem item)
          Adds a regular text parameter to the set of text parameters for this request.
protected  long getSizeThreshold()
          Returns the size threshold which determines whether an uploaded file will be written to disk or cached in memory.
 void handleMultipartRequest(RequestWrapper request, javax.servlet.ServletContext servletContext)
          Parses the input stream and partitions the parsed items into a set of form fields and a set of file items.
 void setMemFileSize(java.lang.String memFileSize)
           
 
Methods inherited from class org.hdiv.config.multipart.AbstractMultipartConfig
addFileParameter, convertSizeToBytes, getRepositoryPath, getSizeMax, setMaxFileSize, setTempDir
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

memFileSize

protected java.lang.String memFileSize
The size threshold which determines whether an uploaded file will be written to disk or cached in memory.

Constructor Detail

StrutsMultipartConfig

public StrutsMultipartConfig()
Method Detail

handleMultipartRequest

public void handleMultipartRequest(RequestWrapper request,
                                   javax.servlet.ServletContext servletContext)
                            throws org.apache.commons.fileupload.FileUploadException,
                                   org.apache.commons.fileupload.FileUploadBase.SizeLimitExceededException,
                                   org.springframework.web.multipart.MaxUploadSizeExceededException
Parses the input stream and partitions the parsed items into a set of form fields and a set of file items.

Parameters:
request - The multipart request wrapper.
servletContext - servlet context
Throws:
org.apache.commons.fileupload.FileUploadException - if an unrecoverable error occurs.
DiskFileUpload.SizeLimitExceededException - if size limit exceeded
org.apache.commons.fileupload.FileUploadBase.SizeLimitExceededException
org.springframework.web.multipart.MaxUploadSizeExceededException

getSizeThreshold

protected long getSizeThreshold()
Returns the size threshold which determines whether an uploaded file will be written to disk or cached in memory.

Returns:
The size threshold, in bytes.

addTextParameter

public void addTextParameter(RequestWrapper request,
                             org.apache.commons.fileupload.FileItem item)
Adds a regular text parameter to the set of text parameters for this request. 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.

setMemFileSize

public void setMemFileSize(java.lang.String memFileSize)
Parameters:
memFileSize - The memFileSize to set.

HDIV 2.0.4

Copyright © 2008 hdiv.org. All Rights Reserved.