org.apache.struts.upload

Class DiskMultipartRequestHandler

public class DiskMultipartRequestHandler extends Object implements MultipartRequestHandler

Deprecated: Use the Commons FileUpload based multipart handler instead. This class will be removed after Struts 1.2.

This is a MultipartRequestHandler that writes file data directly to to temporary files on disk.
Field Summary
protected HashtableallElements
A Hashtable representing all elemnents.
protected HashtablefileElements
A Hashtable representing the form files uploaded.
protected static Loglog
Commons Logging instance.
protected ActionMappingmapping
The ActionMapping instance used for this class.
protected ActionServletservlet
The ActionServlet instance used for this class.
protected StringtempDir
The temporary directory.
protected HashtabletextElements
A Hashtable representing the form text input names and values.
Method Summary
protected voidcreateDiskFile(MultipartElement element)
protected voidcreateTextElement(HttpServletRequest request, MultipartElement element)
voidfinish()
Calls on rollback() to delete temporary files.
HashtablegetAllElements()
HashtablegetFileElements()
ActionMappinggetMapping()
protected longgetMaxSize(String stringSize)
Gets the maximum post data size in bytes from the string representation in the configuration file.
ActionServletgetServlet()
HashtablegetTextElements()
voidhandleRequest(HttpServletRequest request)
This method populates the internal hashtables with multipart request data.
protected voidretrieveTempDir(ModuleConfig moduleConfig)
Retrieves the temporary directory from either ActionServlet, a context property, or a system property, in that order.
voidrollback()
Delete all the files uploaded.
voidsetMapping(ActionMapping mapping)
voidsetServlet(ActionServlet servlet)

Field Detail

allElements

protected Hashtable allElements
A Hashtable representing all elemnents.

fileElements

protected Hashtable fileElements
A Hashtable representing the form files uploaded.

log

protected static Log log
Commons Logging instance.

mapping

protected ActionMapping mapping
The ActionMapping instance used for this class.

servlet

protected ActionServlet servlet
The ActionServlet instance used for this class.

tempDir

protected String tempDir
The temporary directory.

textElements

protected Hashtable textElements
A Hashtable representing the form text input names and values.

Method Detail

createDiskFile

protected void createDiskFile(MultipartElement element)

createTextElement

protected void createTextElement(HttpServletRequest request, MultipartElement element)

finish

public void finish()
Calls on rollback() to delete temporary files.

getAllElements

public Hashtable getAllElements()

getFileElements

public Hashtable getFileElements()

getMapping

public ActionMapping getMapping()

getMaxSize

protected long getMaxSize(String stringSize)
Gets the maximum post data size in bytes from the string representation in the configuration file.

getServlet

public ActionServlet getServlet()

getTextElements

public Hashtable getTextElements()

handleRequest

public void handleRequest(HttpServletRequest request)
This method populates the internal hashtables with multipart request data. If the request argument is an instance of MultipartRequestWrapper, the request wrapper will be populated as well.

retrieveTempDir

protected void retrieveTempDir(ModuleConfig moduleConfig)
Retrieves the temporary directory from either ActionServlet, a context property, or a system property, in that order.

rollback

public void rollback()
Delete all the files uploaded.

setMapping

public void setMapping(ActionMapping mapping)

setServlet

public void setServlet(ActionServlet servlet)
Copyright B) 2000-2009 - The Apache Software Foundation