org.apache.commons.fileupload.disk.DiskFileItemFactory
来源:互联网 发布:python 日志收集系统 编辑:程序博客网 时间:2024/06/01 10:21
public class DiskFileItemFactory
- extends java.lang.Object
- implements FileItemFactory
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")
.
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 ofFile
is garbage collected.) Cleaning up those files is done by an instance ofFileCleaningTracker
, 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.
FileItemFactory
的默认实现类。这个实现类负责创建FileItem
的实例,使得FileItem
对应的文件的内容既可以保存在内存中(小文件)又可以作为临时文件保存到硬盘中(大文件)。到底多大的文件才算大文件,临时文件到底存放到硬盘中的什么目录下,都是可以通过设置来指定的。
如果没有设置,那么默认值如下所示:
。大小界限:10KB
。文件存放位置是系统的默认临时文件的存放文件夹,这个具体的值可以通过System.getProperty("java.io.tmpdir")
. 获得
在使用DiskFileItemFactory
的时候,有些地方你需要注意的是:临时文件在不再使用的情况下(更准确地说,就是当File实例被回收机制回收的时候),会由系统自动删除的。FileCleaningTracker负责清除这些文件以及与这些文件有关的进程。在复杂的环境下,例如在web应用中,你应该考虑关掉
的进程。对于这一点,你可以考虑参考commons-fileupload的用户手册关于"Resource cleanup"一章。FileCleaningTracker
- org.apache.commons.fileupload.disk.DiskFileItemFactory
- commons fileupload的DiskFileItemFactory
- org.apache.commons.fileupload.DiskFileUpload
- org.apache.commons.fileupload.DiskFileUpload1
- org.apache.commons.fileupload.FileItemFactory
- org.apache.commons.fileupload的使用
- org.apache.commons.fileupload.DiskFileUpload/FileItem
- org.apache.commons.fileupload. FileItem-api
- org.apache.commons.fileupload.FileItemFactory-api
- org.apache.commons.fileupload.servlet.ServletFileUpload-api
- org.apache.commons.fileupload.FileUploadBase$SizeLimitExceededException
- 文件上传 using org.apache.commons.fileupload
- org.apache.commons.fileupload.FileUploadBase$SizeLimitExceededException:
- org.apache.commons.fileupload.FileUploadBase$InvalidContentTypeException
- org.apache.commons.fileupload.FileUploadBase$SizeLimitExceededException:
- org.apache.commons.fileupload实现文件上传
- 使用org.apache.commons.fileupload上传文件
- org.apache.commons.fileupload.FileUploadBase$SizeLimitExceededException:
- 链接器的使用
- WP7的未来
- Android自动测试之Monkey工具
- 我眼中的云--为什么会出现云
- Introduction and -Tutorial
- org.apache.commons.fileupload.disk.DiskFileItemFactory
- 卸载Oracle11gR2
- 安装qvfb--基于ubuntu11.10
- 123
- Change Log of Joomsport: Add Tournament-Season Name to Group List
- 不知事务码MB1A / MB1B / MB1C之间有什么区别吗?
- 自绘按钮
- 页面高度宽度各浏览器兼容脚本
- nonemptycrossjoin (mdx)