org.apache.commons.fileupload.DiskFileUpload Class Reference

Inheritance diagram for org.apache.commons.fileupload.DiskFileUpload:

org.apache.commons.fileupload.FileUploadBase

List of all members.


Detailed Description

High level API for processing file uploads.

This class handles multiple files per single HTML widget, sent using multipart/mixed encoding type, as specified by RFC 1867. Use parseRequest(HttpServletRequest) to acquire a list of org.apache.commons.fileupload.FileItems associated with a given HTML widget.

Individual parts will be stored in temporary disk storage or in memory, depending on their size, and will be available as org.apache.commons.fileupload.FileItems.

Author:
Rafal Krzewski

Daniel Rall

Jason van Zyl

John McNally

Martin Cooper

Sean C. Sullivan

Version:
Id
DiskFileUpload.java,v 1.3 2003/06/01 00:18:13 martinc Exp

Definition at line 94 of file DiskFileUpload.java.


Public Member Functions

 DiskFileUpload ()
 Constructs an instance of this class which uses the default factory to create FileItem instances.
 DiskFileUpload (DefaultFileItemFactory fileItemFactory)
 Constructs an instance of this class which uses the supplied factory to create FileItem instances.
FileItemFactory getFileItemFactory ()
 Returns the factory class used when creating file items.
void setFileItemFactory (FileItemFactory factory)
 Sets the factory class to use when creating file items.
int getSizeThreshold ()
 Returns the size threshold beyond which files are written directly to disk.
void setSizeThreshold (int sizeThreshold)
 Sets the size threshold beyond which files are written directly to disk.
String getRepositoryPath ()
 Returns the location used to temporarily store files that are larger than the configured size threshold.
void setRepositoryPath (String repositoryPath)
 Sets the location used to temporarily store files that are larger than the configured size threshold.
List parseRequest (HttpServletRequest req, int sizeThreshold, long sizeMax, String path) throws FileUploadException
 Processes an RFC 1867 compliant multipart/form-data stream.

Constructor & Destructor Documentation

org.apache.commons.fileupload.DiskFileUpload.DiskFileUpload (  ) 

Constructs an instance of this class which uses the default factory to create FileItem instances.

See also:
DiskFileUpload(DefaultFileItemFactory fileItemFactory)

Definition at line 116 of file DiskFileUpload.java.

org.apache.commons.fileupload.DiskFileUpload.DiskFileUpload ( DefaultFileItemFactory  fileItemFactory  ) 

Constructs an instance of this class which uses the supplied factory to create FileItem instances.

See also:
DiskFileUpload()

Definition at line 129 of file DiskFileUpload.java.


Member Function Documentation

FileItemFactory org.apache.commons.fileupload.DiskFileUpload.getFileItemFactory (  )  [virtual]

Returns the factory class used when creating file items.

Returns:
The factory class for new file items.

Implements org.apache.commons.fileupload.FileUploadBase.

Definition at line 144 of file DiskFileUpload.java.

void org.apache.commons.fileupload.DiskFileUpload.setFileItemFactory ( FileItemFactory  factory  )  [virtual]

Sets the factory class to use when creating file items.

The factory must be an instance of DefaultFileItemFactory or a subclass thereof, or else a ClassCastException will be thrown.

Parameters:
factory The factory class for new file items.

Implements org.apache.commons.fileupload.FileUploadBase.

Definition at line 157 of file DiskFileUpload.java.

int org.apache.commons.fileupload.DiskFileUpload.getSizeThreshold (  ) 

Returns the size threshold beyond which files are written directly to disk.

Returns:
The size threshold, in bytes.
See also:
setSizeThreshold(int)

Definition at line 171 of file DiskFileUpload.java.

References org.apache.commons.fileupload.DefaultFileItemFactory.getSizeThreshold().

void org.apache.commons.fileupload.DiskFileUpload.setSizeThreshold ( int  sizeThreshold  ) 

Sets the size threshold beyond which files are written directly to disk.

Parameters:
sizeThreshold The size threshold, in bytes.
See also:
getSizeThreshold()

Definition at line 184 of file DiskFileUpload.java.

References org.apache.commons.fileupload.DefaultFileItemFactory.setSizeThreshold().

Referenced by org.apache.commons.fileupload.DiskFileUpload.parseRequest().

String org.apache.commons.fileupload.DiskFileUpload.getRepositoryPath (  ) 

Returns the location used to temporarily store files that are larger than the configured size threshold.

Returns:
The path to the temporary file location.
See also:
setRepositoryPath(String)

Definition at line 198 of file DiskFileUpload.java.

References org.apache.commons.fileupload.DefaultFileItemFactory.getRepository().

void org.apache.commons.fileupload.DiskFileUpload.setRepositoryPath ( String  repositoryPath  ) 

Sets the location used to temporarily store files that are larger than the configured size threshold.

Parameters:
repositoryPath The path to the temporary file location.
See also:
getRepositoryPath()

Definition at line 212 of file DiskFileUpload.java.

References org.apache.commons.fileupload.DefaultFileItemFactory.setRepository().

Referenced by org.apache.commons.fileupload.DiskFileUpload.parseRequest().

List org.apache.commons.fileupload.DiskFileUpload.parseRequest ( HttpServletRequest  req,
int  sizeThreshold,
long  sizeMax,
String  path 
) throws FileUploadException

Processes an RFC 1867 compliant multipart/form-data stream.

If files are stored on disk, the path is given by getRepository().

Parameters:
req The servlet request to be parsed. Must be non-null.
sizeThreshold The max size in bytes to be stored in memory.
sizeMax The maximum allowed upload size, in bytes.
path The location where the files should be stored.
Returns:
A list of FileItem instances parsed from the request, in the order that they were transmitted.
Exceptions:
FileUploadException if there are problems reading/parsing the request or storing files.

Definition at line 237 of file DiskFileUpload.java.

References org.apache.commons.fileupload.DiskFileUpload.setRepositoryPath(), org.apache.commons.fileupload.FileUploadBase.setSizeMax(), and org.apache.commons.fileupload.DiskFileUpload.setSizeThreshold().


The documentation for this class was generated from the following file:
Generated on Mon Jan 11 21:19:18 2010 for OpenMobileIS by  doxygen 1.5.4