| java.lang.Object org.apache.commons.fileupload.FileUploadBase
All known Subclasses: org.apache.commons.fileupload.FileUpload, org.apache.commons.fileupload.DiskFileUpload,
Inner Class :public static class FileUploadIOException extends IOException | |
Inner Class :public static class SizeLimitExceededException extends SizeException | |
Inner Class :public static class FileSizeLimitExceededException extends SizeException | |
Method Summary | |
protected FileItem | createItem(Map headers, boolean isFormField) Creates a new
FileItem instance.
Parameters: headers - A Map containing the HTTP requestheaders. Parameters: isFormField - Whether or not this item is a form field, asopposed to a file. | protected byte[] | getBoundary(String contentType) Retrieves the boundary from the Content-type header.
Parameters: contentType - The value of the content type header from which toextract the boundary value. | protected String | getFieldName(Map headers) Retrieves the field name from the Content-disposition
header.
Parameters: headers - A Map containing the HTTP request headers. | abstract public FileItemFactory | getFileItemFactory() Returns the factory class used when creating file items. | protected String | getFileName(Map headers) Retrieves the file name from the Content-disposition
header.
Parameters: headers - A Map containing the HTTP request headers. | public long | getFileSizeMax() Returns the maximum allowed size of a single uploaded file,
as opposed to
FileUploadBase.getSizeMax() . | final protected String | getHeader(Map headers, String name) Returns the header with the specified name from the supplied map. | public String | getHeaderEncoding() Retrieves the character encoding used when reading the headers of an
individual part. | public FileItemIterator | getItemIterator(RequestContext ctx) Processes an RFC 1867
compliant multipart/form-data stream.
Parameters: ctx - The context for the request to be parsed. | public ProgressListener | getProgressListener() Returns the progress listener. | public long | getSizeMax() Returns the maximum allowed size of a complete request, as opposed
to
FileUploadBase.getFileSizeMax() .
The maximum allowed size, in bytes. | final public static boolean | isMultipartContent(RequestContext ctx) Utility method that determines whether the request contains multipart
content.
NOTE:This method will be moved to the
ServletFileUpload class after the FileUpload 1.1 release.
Unfortunately, since this method is static, it is not possible to
provide its replacement until this method is removed.
Parameters: ctx - The request context to be evaluated. | public static boolean | isMultipartContent(HttpServletRequest req) Utility method that determines whether the request contains multipart
content.
Parameters: req - The servlet request to be evaluated. | protected Map | parseHeaders(String headerPart) Parses the header-part and returns as key/value
pairs.
If there are multiple headers of the same names, the name
will map to a comma-separated list containing the values.
Parameters: headerPart - The header-part of the currentencapsulation . | public List | parseRequest(HttpServletRequest req) Processes an RFC 1867
compliant multipart/form-data stream.
Parameters: req - The servlet request to be parsed. | public List | parseRequest(RequestContext ctx) Processes an RFC 1867
compliant multipart/form-data stream.
Parameters: ctx - The context for the request to be parsed. | abstract public void | setFileItemFactory(FileItemFactory factory) Sets the factory class to use when creating file items. | public void | setFileSizeMax(long fileSizeMax) Sets the maximum allowed size of a single uploaded file,
as opposed to
FileUploadBase.getSizeMax() . | public void | setHeaderEncoding(String encoding) Specifies the character encoding to be used when reading the headers of
individual part. | public void | setProgressListener(ProgressListener pListener) Sets the progress listener.
Parameters: pListener - The progress listener, if any. | public void | setSizeMax(long sizeMax) Sets the maximum allowed size of a complete request, as opposed
to
FileUploadBase.setFileSizeMax(long) .
Parameters: sizeMax - The maximum allowed size, in bytes. |
ATTACHMENT | final public static String ATTACHMENT(Code) | | Content-disposition value for file attachment.
|
CONTENT_DISPOSITION | final public static String CONTENT_DISPOSITION(Code) | | HTTP content disposition header name.
|
CONTENT_TYPE | final public static String CONTENT_TYPE(Code) | | HTTP content type header name.
|
FORM_DATA | final public static String FORM_DATA(Code) | | Content-disposition value for form data.
|
MULTIPART | final public static String MULTIPART(Code) | | Part of HTTP content type header.
|
MULTIPART_FORM_DATA | final public static String MULTIPART_FORM_DATA(Code) | | HTTP content type header for multipart forms.
|
MULTIPART_MIXED | final public static String MULTIPART_MIXED(Code) | | HTTP content type header for multiple uploads.
|
createItem | protected FileItem createItem(Map headers, boolean isFormField) throws FileUploadException(Code) | | Creates a new
FileItem instance.
Parameters: headers - A Map containing the HTTP requestheaders. Parameters: isFormField - Whether or not this item is a form field, asopposed to a file. A newly created FileItem instance. throws: FileUploadException - if an error occurs.FileItem |
getBoundary | protected byte[] getBoundary(String contentType)(Code) | | Retrieves the boundary from the Content-type header.
Parameters: contentType - The value of the content type header from which toextract the boundary value. The boundary, as a byte array. |
getFieldName | protected String getFieldName(Map headers)(Code) | | Retrieves the field name from the Content-disposition
header.
Parameters: headers - A Map containing the HTTP request headers. The field name for the current encapsulation . |
getFileItemFactory | abstract public FileItemFactory getFileItemFactory()(Code) | | Returns the factory class used when creating file items.
The factory class for new file items. |
getFileName | protected String getFileName(Map headers)(Code) | | Retrieves the file name from the Content-disposition
header.
Parameters: headers - A Map containing the HTTP request headers. The file name for the current encapsulation . |
getHeader | final protected String getHeader(Map headers, String name)(Code) | | Returns the header with the specified name from the supplied map. The
header lookup is case-insensitive.
Parameters: headers - A Map containing the HTTP request headers. Parameters: name - The name of the header to return. The value of specified header, or a comma-separated list ifthere were multiple headers of that name. |
getHeaderEncoding | public String getHeaderEncoding()(Code) | | Retrieves the character encoding used when reading the headers of an
individual part. When not specified, or null , the request
encoding is used. If that is also not specified, or null ,
the platform default encoding is used.
The encoding used to read part headers. |
getItemIterator | public FileItemIterator getItemIterator(RequestContext ctx) throws FileUploadException, IOException(Code) | | Processes an RFC 1867
compliant multipart/form-data stream.
Parameters: ctx - The context for the request to be parsed. An iterator to instances of FileItemStream parsed from the request, in the order that they weretransmitted. throws: FileUploadException - if there are problems reading/parsingthe request or storing files. throws: IOException - An I/O error occurred. This may be a networkerror while communicating with the client or a problem whilestoring the uploaded content. |
getProgressListener | public ProgressListener getProgressListener()(Code) | | Returns the progress listener.
The progress listener, if any, or null. |
isMultipartContent | final public static boolean isMultipartContent(RequestContext ctx)(Code) | | Utility method that determines whether the request contains multipart
content.
NOTE:This method will be moved to the
ServletFileUpload class after the FileUpload 1.1 release.
Unfortunately, since this method is static, it is not possible to
provide its replacement until this method is removed.
Parameters: ctx - The request context to be evaluated. Must be non-null. true if the request is multipart;false otherwise. |
isMultipartContent | public static boolean isMultipartContent(HttpServletRequest req)(Code) | | Utility method that determines whether the request contains multipart
content.
Parameters: req - The servlet request to be evaluated. Must be non-null. true if the request is multipart;false otherwise. |
parseHeaders | protected Map parseHeaders(String headerPart)(Code) | | Parses the header-part and returns as key/value
pairs.
If there are multiple headers of the same names, the name
will map to a comma-separated list containing the values.
Parameters: headerPart - The header-part of the currentencapsulation . A Map containing the parsed HTTP request headers. |
parseRequest | public List parseRequest(HttpServletRequest req) throws FileUploadException(Code) | | Processes an RFC 1867
compliant multipart/form-data stream.
Parameters: req - The servlet request to be parsed. A list of FileItem instances parsed from therequest, in the order that they were transmitted. throws: FileUploadException - if there are problems reading/parsingthe request or storing files. |
parseRequest | public List parseRequest(RequestContext ctx) throws FileUploadException(Code) | | Processes an RFC 1867
compliant multipart/form-data stream.
Parameters: ctx - The context for the request to be parsed. A list of FileItem instances parsed from therequest, in the order that they were transmitted. throws: FileUploadException - if there are problems reading/parsingthe request or storing files. |
setFileItemFactory | abstract public void setFileItemFactory(FileItemFactory factory)(Code) | | Sets the factory class to use when creating file items.
Parameters: factory - The factory class for new file items. |
setHeaderEncoding | public void setHeaderEncoding(String encoding)(Code) | | Specifies the character encoding to be used when reading the headers of
individual part. When not specified, or null , the request
encoding is used. If that is also not specified, or null ,
the platform default encoding is used.
Parameters: encoding - The encoding used to read part headers. |
setProgressListener | public void setProgressListener(ProgressListener pListener)(Code) | | Sets the progress listener.
Parameters: pListener - The progress listener, if any. Defaults to null. |
|
|