public class DiskFileUpload extends FileUploadBase
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.
FileUploadBase.InvalidContentTypeException, FileUploadBase.SizeLimitExceededException, FileUploadBase.UnknownSizeException| Modifier and Type | Field | Description |
|---|---|---|
private DefaultFileItemFactory |
fileItemFactory |
Deprecated.
The factory to use to create new form items.
|
ATTACHMENT, CONTENT_DISPOSITION, CONTENT_TYPE, FORM_DATA, MAX_HEADER_SIZE, MULTIPART, MULTIPART_FORM_DATA, MULTIPART_MIXED| Constructor | Description |
|---|---|
DiskFileUpload() |
Deprecated.
Use
FileUpload instead. |
DiskFileUpload(DefaultFileItemFactory fileItemFactory) |
Deprecated.
Use
FileUpload instead. |
| Modifier and Type | Method | Description |
|---|---|---|
FileItemFactory |
getFileItemFactory() |
Deprecated.
Use
FileUpload instead. |
java.lang.String |
getRepositoryPath() |
Deprecated.
Use
DiskFileItemFactory instead. |
int |
getSizeThreshold() |
Deprecated.
Use
DiskFileItemFactory instead. |
java.util.List |
parseRequest(javax.servlet.http.HttpServletRequest req,
int sizeThreshold,
long sizeMax,
java.lang.String path) |
Deprecated.
Use
ServletFileUpload instead. |
void |
setFileItemFactory(FileItemFactory factory) |
Deprecated.
Use
FileUpload instead. |
void |
setRepositoryPath(java.lang.String repositoryPath) |
Deprecated.
Use
DiskFileItemFactory instead. |
void |
setSizeThreshold(int sizeThreshold) |
Deprecated.
Use
DiskFileItemFactory instead. |
createItem, getBoundary, getFieldName, getFileCountMax, getFileName, getHeader, getHeaderEncoding, getSizeMax, isMultipartContent, isMultipartContent, parseHeaders, parseRequest, parseRequest, setFileCountMax, setHeaderEncoding, setSizeMaxprivate DefaultFileItemFactory fileItemFactory
public DiskFileUpload()
FileUpload instead.FileItem instances.public DiskFileUpload(DefaultFileItemFactory fileItemFactory)
FileUpload instead.FileItem instances.DiskFileUpload()public FileItemFactory getFileItemFactory()
FileUpload instead.getFileItemFactory in class FileUploadBasepublic void setFileItemFactory(FileItemFactory factory)
FileUpload instead.DefaultFileItemFactory or a subclass
thereof, or else a ClassCastException will be thrown.setFileItemFactory in class FileUploadBasefactory - The factory class for new file items.public int getSizeThreshold()
DiskFileItemFactory instead.setSizeThreshold(int)public void setSizeThreshold(int sizeThreshold)
DiskFileItemFactory instead.sizeThreshold - The size threshold, in bytes.getSizeThreshold()public java.lang.String getRepositoryPath()
DiskFileItemFactory instead.setRepositoryPath(String)public void setRepositoryPath(java.lang.String repositoryPath)
DiskFileItemFactory instead.repositoryPath - The path to the temporary file location.getRepositoryPath()public java.util.List parseRequest(javax.servlet.http.HttpServletRequest req,
int sizeThreshold,
long sizeMax,
java.lang.String path)
throws FileUploadException
ServletFileUpload instead.multipart/form-data stream. If files are stored
on disk, the path is given by getRepository().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.FileItem instances parsed from the
request, in the order that they were transmitted.FileUploadException - if there are problems reading/parsing
the request or storing files.