Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.commons.fileupload
Class DefaultFileItemFactory

    java.lang.Object
      org.apache.commons.fileupload.disk.DiskFileItemFactory
          org.apache.commons.fileupload.DefaultFileItemFactory

All Implemented Interfaces:
  FileItemFactory

Deprecated. Use `DiskFileItemFactory` instead.

    public class DefaultFileItemFactory

extends DiskFileItemFactory

The default `FileItemFactory` implementation. This implementation creates `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")`.

Version:
  $Id: DefaultFileItemFactory.java 479262 2006-11-26 03:09:24Z niallp $
Author:
  Martin Cooper

Field Summary

Fields inherited from class org.apache.commons.fileupload.disk.DiskFileItemFactory
`DEFAULT_SIZE_THRESHOLD`

Constructor Summary
`DefaultFileItemFactory()` Deprecated. Use `DiskFileItemFactory` instead.
`DefaultFileItemFactory(int sizeThreshold, File repository)` Deprecated. Use `DiskFileItemFactory` instead.

Method Summary
`FileItem` | `createItem(String fieldName, String contentType, boolean isFormField, String fileName)` Deprecated. Use `DiskFileItemFactory` instead.

Methods inherited from class org.apache.commons.fileupload.disk.DiskFileItemFactory
`getFileCleaningTracker, getRepository, getSizeThreshold, setFileCleaningTracker, setRepository, setSizeThreshold`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### DefaultFileItemFactory

    public DefaultFileItemFactory()

  Deprecated. Use `DiskFileItemFactory` instead.

  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)

  Deprecated. Use `DiskFileItemFactory` instead.

  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 Detail

### createItem

    public FileItem createItem(String fieldName,
                               String contentType,
                               boolean isFormField,
                               String fileName)

  Deprecated. Use `DiskFileItemFactory` instead.

  Create a new `DefaultFileItem` instance from the supplied parameters and the local factory configuration.

  Specified by:
    `createItem` in interface `FileItemFactory`
  Overrides:
    `createItem` in class `DiskFileItemFactory`
  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.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2002-2010 The Apache Software Foundation. All Rights Reserved.