org.apache.commons.fileupload.DefaultFileItemFactory Class Reference

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

org.apache.commons.fileupload.FileItemFactory

List of all members.


Detailed Description

The default org.apache.commons.fileupload.FileItemFactory implementation. This implementation creates org.apache.commons.fileupload.FileItem instances which keep their content either in memory, for smaller items, or in a temporary file on disk, for larger items. The size threshold, above which content will be stored on disk, is configurable, as is the directory in which temporary files will be created.

If not otherwise configured, the default configuration values are as follows:

Author:
Martin Cooper
Version:
Id
DefaultFileItemFactory.java,v 1.2 2003/05/31 22:31:08 martinc Exp

Definition at line 90 of file DefaultFileItemFactory.java.


Public Member Functions

 DefaultFileItemFactory ()
 Constructs an unconfigured instance of this class.
 DefaultFileItemFactory (int sizeThreshold, File repository)
 Constructs a preconfigured instance of this class.
File getRepository ()
 Returns the directory used to temporarily store files that are larger than the configured size threshold.
void setRepository (File repository)
 Sets the directory used to temporarily store files that are larger than the configured size threshold.
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.
FileItem createItem (String fieldName, String contentType, boolean isFormField, String fileName)
 Create a new org.apache.commons.fileupload.DefaultFileItem instance from the supplied parameters and the local factory configuration.

Static Public Attributes

static final int DEFAULT_SIZE_THRESHOLD = 10240
 The default threshold above which uploads will be stored on disk.

Constructor & Destructor Documentation

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

Constructs an unconfigured instance of this class.

The resulting factory may be configured by calling the appropriate setter methods.

Definition at line 124 of file DefaultFileItemFactory.java.

org.apache.commons.fileupload.DefaultFileItemFactory.DefaultFileItemFactory ( int  sizeThreshold,
File  repository 
)

Constructs a preconfigured instance of this class.

Parameters:
sizeThreshold The threshold, in bytes, below which items will be retained in memory and above which they will be stored as a file.
repository The data repository, which is the directory in which files will be created, should the item size exceed the threshold.

Definition at line 139 of file DefaultFileItemFactory.java.


Member Function Documentation

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

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

Returns:
The directory in which temporary files will be located.
See also:
setRepository(java.io.File)

Definition at line 158 of file DefaultFileItemFactory.java.

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

void org.apache.commons.fileupload.DefaultFileItemFactory.setRepository ( File  repository  ) 

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

Parameters:
repository The directory in which temporary files will be located.
See also:
getRepository()

Definition at line 173 of file DefaultFileItemFactory.java.

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

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

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

The default value is 1024 bytes.

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

Definition at line 187 of file DefaultFileItemFactory.java.

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

void org.apache.commons.fileupload.DefaultFileItemFactory.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 201 of file DefaultFileItemFactory.java.

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

FileItem org.apache.commons.fileupload.DefaultFileItemFactory.createItem ( String  fieldName,
String  contentType,
boolean  isFormField,
String  fileName 
)

Create a new org.apache.commons.fileupload.DefaultFileItem instance from the supplied parameters and the local factory configuration.

Parameters:
fieldName The name of the form field.
contentType The content type of the form field.
isFormField true if this is a plain form field; false otherwise.
fileName The name of the uploaded file, if any, as supplied by the browser or other client.
Returns:
The newly created file item.

Implements org.apache.commons.fileupload.FileItemFactory.

Definition at line 223 of file DefaultFileItemFactory.java.


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