This class handles multiple files per single HTML widget, sent using multipart/mixed
encoding type, as specified by RFC 1867. Use parseRequest(HttpServletRequest) to acquire a list of org.apache.commons.fileupload.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 org.apache.commons.fileupload.FileItems.
Definition at line 94 of file DiskFileUpload.java.
Public Member Functions | |
DiskFileUpload () | |
Constructs an instance of this class which uses the default factory to create FileItem instances. | |
DiskFileUpload (DefaultFileItemFactory fileItemFactory) | |
Constructs an instance of this class which uses the supplied factory to create FileItem instances. | |
FileItemFactory | getFileItemFactory () |
Returns the factory class used when creating file items. | |
void | setFileItemFactory (FileItemFactory factory) |
Sets the factory class to use when creating file items. | |
int | getSizeThreshold () |
Returns the size threshold beyond which files are written directly to disk. | |
void | setSizeThreshold (int sizeThreshold) |
Sets the size threshold beyond which files are written directly to disk. | |
String | getRepositoryPath () |
Returns the location used to temporarily store files that are larger than the configured size threshold. | |
void | setRepositoryPath (String repositoryPath) |
Sets the location used to temporarily store files that are larger than the configured size threshold. | |
List | parseRequest (HttpServletRequest req, int sizeThreshold, long sizeMax, String path) throws FileUploadException |
Processes an RFC 1867 compliant multipart/form-data stream. |
org.apache.commons.fileupload.DiskFileUpload.DiskFileUpload | ( | ) |
Constructs an instance of this class which uses the default factory to create FileItem
instances.
Definition at line 116 of file DiskFileUpload.java.
org.apache.commons.fileupload.DiskFileUpload.DiskFileUpload | ( | DefaultFileItemFactory | fileItemFactory | ) |
Constructs an instance of this class which uses the supplied factory to create FileItem
instances.
Definition at line 129 of file DiskFileUpload.java.
FileItemFactory org.apache.commons.fileupload.DiskFileUpload.getFileItemFactory | ( | ) | [virtual] |
Returns the factory class used when creating file items.
Implements org.apache.commons.fileupload.FileUploadBase.
Definition at line 144 of file DiskFileUpload.java.
void org.apache.commons.fileupload.DiskFileUpload.setFileItemFactory | ( | FileItemFactory | factory | ) | [virtual] |
Sets the factory class to use when creating file items.
The factory must be an instance of DefaultFileItemFactory
or a subclass thereof, or else a ClassCastException
will be thrown.
factory | The factory class for new file items. |
Implements org.apache.commons.fileupload.FileUploadBase.
Definition at line 157 of file DiskFileUpload.java.
int org.apache.commons.fileupload.DiskFileUpload.getSizeThreshold | ( | ) |
Returns the size threshold beyond which files are written directly to disk.
Definition at line 171 of file DiskFileUpload.java.
References org.apache.commons.fileupload.DefaultFileItemFactory.getSizeThreshold().
void org.apache.commons.fileupload.DiskFileUpload.setSizeThreshold | ( | int | sizeThreshold | ) |
Sets the size threshold beyond which files are written directly to disk.
sizeThreshold | The size threshold, in bytes. |
Definition at line 184 of file DiskFileUpload.java.
References org.apache.commons.fileupload.DefaultFileItemFactory.setSizeThreshold().
Referenced by org.apache.commons.fileupload.DiskFileUpload.parseRequest().
String org.apache.commons.fileupload.DiskFileUpload.getRepositoryPath | ( | ) |
Returns the location used to temporarily store files that are larger than the configured size threshold.
Definition at line 198 of file DiskFileUpload.java.
References org.apache.commons.fileupload.DefaultFileItemFactory.getRepository().
void org.apache.commons.fileupload.DiskFileUpload.setRepositoryPath | ( | String | repositoryPath | ) |
Sets the location used to temporarily store files that are larger than the configured size threshold.
repositoryPath | The path to the temporary file location. |
Definition at line 212 of file DiskFileUpload.java.
References org.apache.commons.fileupload.DefaultFileItemFactory.setRepository().
Referenced by org.apache.commons.fileupload.DiskFileUpload.parseRequest().
List org.apache.commons.fileupload.DiskFileUpload.parseRequest | ( | HttpServletRequest | req, | |
int | sizeThreshold, | |||
long | sizeMax, | |||
String | path | |||
) | throws FileUploadException |
Processes an RFC 1867 compliant 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. |
Definition at line 237 of file DiskFileUpload.java.
References org.apache.commons.fileupload.DiskFileUpload.setRepositoryPath(), org.apache.commons.fileupload.FileUploadBase.setSizeMax(), and org.apache.commons.fileupload.DiskFileUpload.setSizeThreshold().