The default
org.apache.commons.fileupload.FileItemFactoryimplementation. This implementation creates
org.apache.commons.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")
.
When using the DiskFileItemFactory
, then you should
consider the following: Temporary files are automatically deleted as
soon as they are no longer needed. (More precisely, when the
corresponding instance of
java.io.File is garbage collected.)
Cleaning up those files is done by an instance of
FileCleaningTracker, and an associated thread. In a complex
environment, for example in a web application, you should consider
terminating this thread, for example, when your web application
ends. See the section on "Resource cleanup"
in the users guide of commons-fileupload.