The default {@link org.apache.wicket.util.upload.FileItemFactory} implementation. Thisimplementation creates {@link org.apache.wicket.util.upload.FileItem} instances which keep theircontent 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 {@link java.io.File} is garbage collected.) Cleaning up thosefiles is done by an instance of {@link 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.
@author
Martin Cooper