| java.lang.Object org.apache.tomcat.util.http.fileupload.DefaultFileItemFactory
DefaultFileItemFactory | public class DefaultFileItemFactory implements FileItemFactory(Code) | | The default
org.apache.tomcat.util.http.fileupload.FileItemFactory implementation. This implementation creates
org.apache.tomcat.util.http.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:
- Size threshold is 10KB.
- Repository is the system default temp directory, as returned by
System.getProperty("java.io.tmpdir") .
author: Martin Cooper version: $Id: DefaultFileItemFactory.java 467222 2006-10-24 03:17:11Z markt $ |
Field Summary | |
final public static int | DEFAULT_SIZE_THRESHOLD The default threshold above which uploads will be stored on disk. |
Method Summary | |
public FileItem | createItem(String fieldName, String contentType, boolean isFormField, String fileName) Create a new
org.apache.tomcat.util.http.fileupload.DefaultFileItem instance from the supplied parameters and the local factory
configuration.
Parameters: fieldName - The name of the form field. Parameters: contentType - The content type of the form field. Parameters: isFormField - true if this is a plain form field;false otherwise. Parameters: fileName - The name of the uploaded file, if any, as suppliedby the browser or other client. | public File | getRepository() Returns the directory used to temporarily store files that are larger
than the configured size threshold. | public int | getSizeThreshold() Returns the size threshold beyond which files are written directly to
disk. | public void | setRepository(File repository) Sets the directory used to temporarily store files that are larger
than the configured size threshold. | public void | setSizeThreshold(int sizeThreshold) Sets the size threshold beyond which files are written directly to disk. |
DEFAULT_SIZE_THRESHOLD | final public static int DEFAULT_SIZE_THRESHOLD(Code) | | The default threshold above which uploads will be stored on disk.
|
DefaultFileItemFactory | public DefaultFileItemFactory()(Code) | | Constructs an unconfigured instance of this class. The resulting factory
may be configured by calling the appropriate setter methods.
|
DefaultFileItemFactory | public DefaultFileItemFactory(int sizeThreshold, File repository)(Code) | | Constructs a preconfigured instance of this class.
Parameters: sizeThreshold - The threshold, in bytes, below which items will beretained in memory and above which they will bestored as a file. Parameters: repository - The data repository, which is the directory inwhich files will be created, should the item sizeexceed the threshold. |
createItem | public FileItem createItem(String fieldName, String contentType, boolean isFormField, String fileName)(Code) | | Create a new
org.apache.tomcat.util.http.fileupload.DefaultFileItem instance from the supplied parameters and the local factory
configuration.
Parameters: fieldName - The name of the form field. Parameters: contentType - The content type of the form field. Parameters: isFormField - true if this is a plain form field;false otherwise. Parameters: fileName - The name of the uploaded file, if any, as suppliedby the browser or other client. The newly created file item. |
setRepository | public void setRepository(File repository)(Code) | | 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: DefaultFileItemFactory.getRepository() |
setSizeThreshold | public void setSizeThreshold(int sizeThreshold)(Code) | | Sets the size threshold beyond which files are written directly to disk.
Parameters: sizeThreshold - The size threshold, in bytes. See Also: DefaultFileItemFactory.getSizeThreshold() |
|
|