public class ServletFileUpload extends FileUpload
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
parseRequest(HttpServletRequest) to acquire a list of
IFileItems associated with a given HTML
widget.
How the data for individual parts is stored is determined by the factory used to create them; a given part may be in memory, on disk, or somewhere else.
| Constructor and Description |
|---|
ServletFileUpload(IFileItemFactory aFileItemFactory)
Constructs an instance of this class which uses the supplied factory to
create
FileItem instances. |
| Modifier and Type | Method and Description |
|---|---|
IFileItemIterator |
getItemIterator(javax.servlet.http.HttpServletRequest aHttpRequest)
Processes an RFC 1867
compliant
multipart/form-data stream. |
com.helger.commons.collection.impl.ICommonsList<IFileItem> |
parseRequest(javax.servlet.http.HttpServletRequest aHttpRequest)
Processes an RFC 1867
compliant
multipart/form-data stream. |
getFileItemFactorycreateFileItemHeaders, getBoundary, getFieldName, getFileName, getFileSizeMax, getHeaderEncoding, getItemIterator, getParsedHeaders, getProgressListener, getSizeMax, parseRequest, setFileSizeMax, setHeaderEncoding, setProgressListener, setSizeMaxpublic ServletFileUpload(@Nonnull IFileItemFactory aFileItemFactory)
FileItem instances.aFileItemFactory - The factory to use for creating file items.@Nonnull @ReturnsMutableCopy public com.helger.commons.collection.impl.ICommonsList<IFileItem> parseRequest(@Nonnull javax.servlet.http.HttpServletRequest aHttpRequest) throws FileUploadException
multipart/form-data stream.aHttpRequest - The servlet request to be parsed.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.@Nonnull public IFileItemIterator getItemIterator(@Nonnull javax.servlet.http.HttpServletRequest aHttpRequest) throws FileUploadException, IOException
multipart/form-data stream.aHttpRequest - The servlet request to be parsed.FileItemStream parsed from
the request, in the order that they were transmitted.FileUploadException - if there are problems reading/parsing the request or storing files.IOException - An I/O error occurred. This may be a network error while
communicating with the client or a problem while storing the
uploaded content.Copyright © 2014–2019 Philip Helger. All rights reserved.