Home » apache-tomcat-6.0.26-src » org.apache » tomcat » util » http » fileupload » [javadoc | source]
org.apache.tomcat.util.http.fileupload
public class: DefaultFileItemFactory [javadoc | source]
java.lang.Object
   org.apache.tomcat.util.http.fileupload.DefaultFileItemFactory

All Implemented Interfaces:
    FileItemFactory

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:

Field Summary
public static final  int DEFAULT_SIZE_THRESHOLD    The default threshold above which uploads will be stored on disk. 
Constructor:
 public DefaultFileItemFactory() 
 public 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.
Method from org.apache.tomcat.util.http.fileupload.DefaultFileItemFactory Summary:
createItem,   getRepository,   getSizeThreshold,   setRepository,   setSizeThreshold
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.tomcat.util.http.fileupload.DefaultFileItemFactory Detail:
 public FileItem createItem(String fieldName,
    String contentType,
    boolean isFormField,
    String fileName) 
 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. The default value is 1024 bytes.
 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.