| java.lang.Object net.jforum.util.legacy.commons.fileupload.FileUploadBase net.jforum.util.legacy.commons.fileupload.DiskFileUpload
DiskFileUpload | public class DiskFileUpload extends FileUploadBase (Code) | | 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
DiskFileUpload.parseRequest(HttpServletRequest) to acquire a list of
org.apache.commons.fileupload.FileItem s 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.FileItem s.
author: Rafal Krzewski author: Daniel Rall author: Jason van Zyl author: John McNally author: Martin Cooper author: Sean C. Sullivan version: $Id: DiskFileUpload.java,v 1.4 2005/07/26 04:01:16 diegopires Exp $ |
Constructor Summary | |
public | DiskFileUpload() Constructs an instance of this class which uses the default factory to
create FileItem instances. | public | DiskFileUpload(DefaultFileItemFactory fileItemFactory) Constructs an instance of this class which uses the supplied factory to
create FileItem instances. |
getFileItemFactory | public FileItemFactory getFileItemFactory()(Code) | | Returns the factory class used when creating file items.
The factory class for new file items. |
parseRequest | public List parseRequest(HttpServletRequest req, int sizeThreshold, long sizeMax, String path) throws FileUploadException(Code) | | Processes an RFC 1867
compliant multipart/form-data stream. If files are stored
on disk, the path is given by getRepository() .
Parameters: req - The servlet request to be parsed. Must be non-null. Parameters: sizeThreshold - The max size in bytes to be stored in memory. Parameters: sizeMax - The maximum allowed upload size, in bytes. Parameters: path - The location where the files should be stored. A list of FileItem instances parsed from therequest, in the order that they were transmitted. exception: FileUploadException - if there are problems reading/parsingthe request or storing files. |
setFileItemFactory | public void setFileItemFactory(FileItemFactory factory)(Code) | | 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.
Parameters: factory - The factory class for new file items. |
setRepositoryPath | public void setRepositoryPath(String repositoryPath)(Code) | | Sets the location used to temporarily store files that are larger
than the configured size threshold.
Parameters: repositoryPath - The path to the temporary file location. See Also: DiskFileUpload.getRepositoryPath() |
setSizeThreshold | public void setSizeThreshold(int sizeThreshold)(Code) | | Sets the size threshold beyond which files are written directly to disk.
Parameters: sizeThreshold - The size threshold, in bytes. See Also: DiskFileUpload.getSizeThreshold() |
|
|