public interface DiskFileItemFactory
A factory interface for creating FileItem
and Media
instances.
Factories can provide their own custom configuration, over and above that provided
by the default file upload implementation.
Unlike FileItemFactory
, this factory
needs two extra information, sizeThreshold and repository.
Modifier and Type | Method and Description |
---|---|
org.apache.commons.fileupload.FileItem |
createItem(java.lang.String fieldName,
java.lang.String contentType,
boolean isFormField,
java.lang.String fileName,
int sizeThreshold,
java.io.File repository)
Create a new
FileItem instance from the supplied parameters and
any local factory configuration. |
Media |
createMedia(org.apache.commons.fileupload.FileItem fileItem,
java.lang.String contentType,
java.lang.String fileName,
boolean isNative)
Create a new
Media instance from from the supplied parameters and
any local factory configuration. |
org.apache.commons.fileupload.FileItem createItem(java.lang.String fieldName, java.lang.String contentType, boolean isFormField, java.lang.String fileName, int sizeThreshold, java.io.File repository)
FileItem
instance from the supplied parameters and
any local factory configuration.fieldName
- The name of the form field.contentType
- The content type of the form field.isFormField
- true
if this is a plain form field;
false
otherwise.fileName
- The name of the uploaded file, if any, as supplied
by the browser or other client.sizeThreshold
- The threshold, in bytes, below which items will be
retained in memory and above which they will be
stored as a file, if any.repository
- The data repository, which is the directory in
which files will be created, should the item size
exceed the threshold, if any.Media createMedia(org.apache.commons.fileupload.FileItem fileItem, java.lang.String contentType, java.lang.String fileName, boolean isNative)
Media
instance from from the supplied parameters and
any local factory configuration.fileItem
- The instance of the upload file.contentType
- The content type of the form field.fileName
- The name of the uploaded file, if any, as supplied
by the browser or other client.isNative
- whether the file item is a binary type.Copyright © 2005-2022 Potix Corporation. All Rights Reserved.