|
Apache Tomcat 6.0.53 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.apache.tomcat.util.http.fileupload.FileUploadBase
org.apache.tomcat.util.http.fileupload.DiskFileUpload
public class DiskFileUpload
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.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class org.apache.tomcat.util.http.fileupload.FileUploadBase |
|---|
FileUploadBase.InvalidContentTypeException, FileUploadBase.SizeLimitExceededException, FileUploadBase.UnknownSizeException |
| Field Summary |
|---|
| Fields inherited from class org.apache.tomcat.util.http.fileupload.FileUploadBase |
|---|
ATTACHMENT, CONTENT_DISPOSITION, CONTENT_TYPE, FORM_DATA, MAX_HEADER_SIZE, MULTIPART, MULTIPART_FORM_DATA, MULTIPART_MIXED |
| Constructor Summary | |
|---|---|
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. |
|
| Method Summary | |
|---|---|
FileItemFactory |
getFileItemFactory()
Returns the factory class used when creating file items. |
java.lang.String |
getRepositoryPath()
Returns the location used to temporarily store files that are larger than the configured size threshold. |
int |
getSizeThreshold()
Returns the size threshold beyond which files are written directly to disk. |
java.util.List |
parseRequest(javax.servlet.http.HttpServletRequest req,
int sizeThreshold,
long sizeMax,
java.lang.String path)
Processes an RFC 1867 compliant multipart/form-data stream. |
void |
setFileItemFactory(FileItemFactory factory)
Sets the factory class to use when creating file items. |
void |
setRepositoryPath(java.lang.String repositoryPath)
Sets the location used to temporarily store files that are larger than the configured size threshold. |
void |
setSizeThreshold(int sizeThreshold)
Sets the size threshold beyond which files are written directly to disk. |
| Methods inherited from class org.apache.tomcat.util.http.fileupload.FileUploadBase |
|---|
createItem, getFieldName, getFileName, getHeader, getHeaderEncoding, getSizeMax, isMultipartContent, parseHeaders, parseRequest, setHeaderEncoding, setSizeMax |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DiskFileUpload()
FileItem instances.
DiskFileUpload(DefaultFileItemFactory fileItemFactory)public DiskFileUpload(DefaultFileItemFactory fileItemFactory)
FileItem instances.
DiskFileUpload()| Method Detail |
|---|
public FileItemFactory getFileItemFactory()
getFileItemFactory in class FileUploadBasepublic void setFileItemFactory(FileItemFactory factory)
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()
setSizeThreshold(int)public void setSizeThreshold(int sizeThreshold)
sizeThreshold - The size threshold, in bytes.getSizeThreshold()public java.lang.String getRepositoryPath()
setRepositoryPath(String)public void setRepositoryPath(java.lang.String repositoryPath)
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
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.
|
Apache Tomcat 6.0.53 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||