public class FileItemIteratorImpl extends Object implements FileItemIterator
FileUploadBase.getItemIterator(RequestContext).| Constructor and Description |
|---|
FileItemIteratorImpl(FileUploadBase pFileUploadBase,
RequestContext pRequestContext)
Creates a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
List<FileItem> |
getFileItems() |
long |
getFileSizeMax()
Returns the maximum size of a single file.
|
MultipartStream |
getMultiPartStream() |
long |
getSizeMax()
Returns the maximum size of the complete HTTP request.
|
boolean |
hasNext()
Returns, whether another instance of
FileItemStream
is available. |
protected void |
init(FileUploadBase fileUploadBase,
RequestContext pRequestContext) |
FileItemStream |
next()
Returns the next available
FileItemStream. |
void |
setFileSizeMax(long fileSizeMax)
Sets the maximum size of a single file.
|
void |
setSizeMax(long sizeMax)
Returns the maximum size of the complete HTTP request.
|
public FileItemIteratorImpl(FileUploadBase pFileUploadBase, RequestContext pRequestContext) throws FileUploadException, IOException
pFileUploadBase - Upload instancepRequestContext - The request context.FileUploadException - An error occurred while
parsing the request.IOException - An I/O error occurred.public long getSizeMax()
FileItemIteratorSizeLimitExceededException
will be thrown, if the HTTP request will exceed this value.
By default, this value will be copied from the FileUploadBase object, however, the user may replace the default value with a
request specific value by invoking FileItemIterator.setSizeMax(long) on this object.getSizeMax in interface FileItemIteratorpublic void setSizeMax(long sizeMax)
FileItemIteratorSizeLimitExceededException
will be thrown, if the HTTP request will exceed this value.
By default, this value will be copied from the FileUploadBase object, however, the user may replace the default value with a
request specific value by invoking FileItemIterator.setSizeMax(long) on this object.
Note: Setting the maximum size on this object will work only, if the iterator is not
yet initialized. In other words: If the methods FileItemIterator.hasNext(), FileItemIterator.next() have not
yet been invoked.setSizeMax in interface FileItemIteratorsizeMax - The maximum size of the complete HTTP request. The value -1 indicates "unlimited".public long getFileSizeMax()
FileItemIteratorFileSizeLimitExceededException
will be thrown, if there is an uploaded file, which is exceeding this value.
By default, this value will be copied from the FileUploadBase object, however, the user may replace the default value with a
request specific value by invoking FileItemIterator.setFileSizeMax(long) on this object.getFileSizeMax in interface FileItemIteratorpublic void setFileSizeMax(long fileSizeMax)
FileItemIteratorFileSizeLimitExceededException
will be thrown, if there is an uploaded file, which is exceeding this value.
By default, this value will be copied from the FileUploadBase object, however, the user may replace the default value with a
request specific value by invoking FileItemIterator.setFileSizeMax(long) on this object, so
there is no need to configure it here.
Note:Changing this value doesn't affect files, that have already been uploaded.setFileSizeMax in interface FileItemIteratorfileSizeMax - The maximum size of a single, uploaded file. The value -1 indicates "unlimited".protected void init(FileUploadBase fileUploadBase, RequestContext pRequestContext) throws FileUploadException, IOException
FileUploadExceptionIOExceptionpublic MultipartStream getMultiPartStream() throws FileUploadException, IOException
FileUploadExceptionIOExceptionpublic boolean hasNext()
throws FileUploadException,
IOException
FileItemStream
is available.hasNext in interface FileItemIteratorFileUploadException - Parsing or processing the
file item failed.IOException - Reading the file item failed.public FileItemStream next() throws FileUploadException, IOException
FileItemStream.next in interface FileItemIteratorNoSuchElementException - No more items are
available. Use hasNext() to prevent this exception.FileUploadException - Parsing or processing the
file item failed.IOException - Reading the file item failed.public List<FileItem> getFileItems() throws FileUploadException, IOException
getFileItems in interface FileItemIteratorFileUploadExceptionIOExceptionCopyright © 2000-2020 Apache Software Foundation. All Rights Reserved.