Class DiskFileUpload

java.lang.Object
org.apache.commons.fileupload.FileUploadBase
org.apache.commons.fileupload.DiskFileUpload

Deprecated.
1.1 Use ServletFileUpload together with DiskFileItemFactory instead.

High level API for processing file uploads.

This class handles multiple files per single HTML widget, sent using multipart/mixed encoding type, as specified by RFC 1867. Use FileUploadBase.parseRequest(HttpServletRequest) to acquire a list of FileItems associated with a given HTML widget.

Individual parts will be stored in temporary disk storage or in memory, depending on their size, and will be available as FileItems.

  • Constructor Details

  • Method Details

    • getFileItemFactory

      Deprecated.
      1.1 Use FileUpload instead.
      Returns the factory class used when creating file items.
      Specified by:
      getFileItemFactory in class FileUploadBase
      Returns:
      The factory class for new file items.
    • getRepositoryPath

      Deprecated.
      1.1 Use DiskFileItemFactory instead.
      Returns the location used to temporarily store files that are larger than the configured size threshold.
      Returns:
      The path to the temporary file location.
      See Also:
    • getSizeThreshold

      Deprecated.
      1.1 Use DiskFileItemFactory instead.
      Returns the size threshold beyond which files are written directly to disk.
      Returns:
      The size threshold, in bytes.
      See Also:
    • parseRequest

      @Deprecated public List<FileItem> parseRequest(javax.servlet.http.HttpServletRequest req, int sizeThreshold, long sizeMax, String path) throws FileUploadException
      Deprecated.
      1.1 Use ServletFileUpload instead.
      Processes an RFC 1867 compliant multipart/form-data stream. If files are stored on disk, the path is given by getRepository().
      Parameters:
      req - The servlet request to be parsed. Must be non-null.
      sizeThreshold - The max size in bytes to be stored in memory.
      sizeMax - The maximum allowed upload size, in bytes.
      path - The location where the files should be stored.
      Returns:
      A list of FileItem instances parsed from the request, in the order that they were transmitted.
      Throws:
      FileUploadException - if there are problems reading/parsing the request or storing files.
    • setFileItemFactory

      @Deprecated public void setFileItemFactory(FileItemFactory fileItemFactory)
      Deprecated.
      1.1 Use FileUpload instead.
      Sets the factory class to use when creating file items. The factory must be an instance of DefaultFileItemFactory or a subclass thereof, or else a ClassCastException will be thrown.
      Specified by:
      setFileItemFactory in class FileUploadBase
      Parameters:
      fileItemFactory - The factory class for new file items.
    • setRepositoryPath

      @Deprecated public void setRepositoryPath(String repositoryPath)
      Deprecated.
      1.1 Use DiskFileItemFactory instead.
      Sets the location used to temporarily store files that are larger than the configured size threshold.
      Parameters:
      repositoryPath - The path to the temporary file location.
      See Also:
    • setSizeThreshold

      @Deprecated public void setSizeThreshold(int sizeThreshold)
      Deprecated.
      1.1 Use DiskFileItemFactory instead.
      Sets the size threshold beyond which files are written directly to disk.
      Parameters:
      sizeThreshold - The size threshold, in bytes.
      See Also: