org.directwebremoting.dwrp
Class CommonsFileUpload

java.lang.Object
  extended by org.directwebremoting.dwrp.CommonsFileUpload
All Implemented Interfaces:
FileUpload

public class CommonsFileUpload
extends java.lang.Object
implements FileUpload

An implementation of FileUpload that uses Apache Commons FileUpload. This class with fail to classload if commons-fileupload.jar is not present on the classpath.

Author:
Joe Walker [joe at getahead dot ltd dot uk]

Field Summary
static java.lang.String PROGRESS_LISTENER
          The name of the attribute that stores the progress of an upload in a session.
 
Constructor Summary
CommonsFileUpload()
           
 
Method Summary
 long getFileUploadMaxBytes()
          Retrieves the maximum allowed size of a single uploaded file, in bytes.
 boolean isMultipartContent(javax.servlet.http.HttpServletRequest req)
           
 java.util.Map<java.lang.String,FormField> parseRequest(javax.servlet.http.HttpServletRequest req)
          Process an inbound request into a set of name/value pairs where the values could be file uploads.
 void setFileUploadMaxBytes(long fileUploadMaxBytes)
          Sets the maximum allowed size of a single uploaded file.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROGRESS_LISTENER

public static final java.lang.String PROGRESS_LISTENER
The name of the attribute that stores the progress of an upload in a session.

See Also:
Constant Field Values
Constructor Detail

CommonsFileUpload

public CommonsFileUpload()
Method Detail

isMultipartContent

public boolean isMultipartContent(javax.servlet.http.HttpServletRequest req)

parseRequest

public java.util.Map<java.lang.String,FormField> parseRequest(javax.servlet.http.HttpServletRequest req)
                                                       throws ServerException
Description copied from interface: FileUpload
Process an inbound request into a set of name/value pairs where the values could be file uploads.

Specified by:
parseRequest in interface FileUpload
Parameters:
req - The request to parse
Returns:
A map of the fields in the input request
Throws:
ServerException - If there is an IOException while reading the request

getFileUploadMaxBytes

public long getFileUploadMaxBytes()
Retrieves the maximum allowed size of a single uploaded file, in bytes.

Returns:
long fileUploadMaxBytes

setFileUploadMaxBytes

public void setFileUploadMaxBytes(long fileUploadMaxBytes)
Sets the maximum allowed size of a single uploaded file.

Parameters:
fileUploadMaxBytes -

Copyright 2008