org.apache.commons.fileupload

## Class DefaultFileItem

- java.lang.Object
- - org.apache.commons.fileupload.disk.DiskFileItem
  - - org.apache.commons.fileupload.DefaultFileItem

- All Implemented Interfaces:
    FileItem, FileItemHeadersSupport

  Deprecated.
  1.1 Use `DiskFileItem` instead.

      @Deprecated
      public class DefaultFileItem
      extends DiskFileItem

  The default implementation of the `FileItem` interface.

  After retrieving an instance of this class from a `DiskFileUpload` instance (see `#parseRequest(javax.servlet.http.HttpServletRequest)`), you may either request all contents of file at once using `DiskFileItem.get()` or request an `InputStream` with `DiskFileItem.getInputStream()` and process the file without attempting to load it into memory, which may come handy with large files.

- - ### Field Summary

    - ### Fields inherited from class org.apache.commons.fileupload.disk.DiskFileItem

      `DEFAULT_CHARSET`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `DefaultFileItem(String fieldName, String contentType, boolean isFormField, String fileName, int sizeThreshold, File repository)` Deprecated. 1.1 Use `DiskFileItem` instead.

  - ### Method Summary

    - ### Methods inherited from class org.apache.commons.fileupload.disk.DiskFileItem

      `delete, finalize, get, getCharSet, getContentType, getDefaultCharset, getFieldName, getHeaders, getInputStream, getName, getOutputStream, getSize, getStoreLocation, getString, getString, getTempFile, isFormField, isInMemory, setDefaultCharset, setFieldName, setFormField, setHeaders, toString, write`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### DefaultFileItem

          @Deprecated
          public DefaultFileItem(String fieldName,
                                             String contentType,
                                             boolean isFormField,
                                             String fileName,
                                             int sizeThreshold,
                                             File repository)

      Deprecated. 1.1 Use `DiskFileItem` instead.
      Constructs a new `DefaultFileItem` instance.
      Parameters:
        `fieldName` - The name of the form field.
        `contentType` - The content type passed by the browser or `null` if not specified.
        `isFormField` - Whether or not this item is a plain form field, as opposed to a file upload.
        `fileName` - The original filename in the user's filesystem, or `null` if not specified.
        `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.

Copyright © 2002–2019 The Apache Software Foundation. All rights reserved.