private class FileUploadBase.FileItemIteratorImpl extends java.lang.Object implements FileItemIterator
FileUploadBase.getItemIterator(RequestContext)
.Modifier and Type | Class and Description |
---|---|
private class |
FileUploadBase.FileItemIteratorImpl.FileItemStreamImpl
Default implementation of
FileItemStream . |
Modifier and Type | Field and Description |
---|---|
private byte[] |
boundary
The boundary, which separates the various parts.
|
private java.lang.String |
currentFieldName
The current items field name.
|
private FileUploadBase.FileItemIteratorImpl.FileItemStreamImpl |
currentItem
The item, which we currently process.
|
private boolean |
eof
Whether we have seen the end of the file.
|
private boolean |
itemValid
Whether the current item may still be read.
|
private MultipartStream |
multi
The multi part stream to process.
|
private MultipartStream.ProgressNotifier |
notifier
The notifier, which used for triggering the
ProgressListener . |
private boolean |
skipPreamble
Whether we are currently skipping the preamble.
|
Constructor and Description |
---|
FileItemIteratorImpl(RequestContext ctx)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
private boolean |
findNextItem()
Called for finding the nex item, if any.
|
private long |
getContentLength(FileItemHeaders pHeaders) |
boolean |
hasNext()
Returns, whether another instance of
FileItemStream
is available. |
FileItemStream |
next()
Returns the next available
FileItemStream . |
private final MultipartStream multi
private final MultipartStream.ProgressNotifier notifier
ProgressListener
.private final byte[] boundary
private FileUploadBase.FileItemIteratorImpl.FileItemStreamImpl currentItem
private java.lang.String currentFieldName
private boolean skipPreamble
private boolean itemValid
private boolean eof
FileItemIteratorImpl(RequestContext ctx) throws FileUploadException, java.io.IOException
ctx
- The request context.FileUploadException
- An error occurred while
parsing the request.java.io.IOException
- An I/O error occurred.private boolean findNextItem() throws java.io.IOException
java.io.IOException
- An I/O error occurred.private long getContentLength(FileItemHeaders pHeaders)
public boolean hasNext() throws FileUploadException, java.io.IOException
FileItemStream
is available.hasNext
in interface FileItemIterator
FileUploadException
- Parsing or processing the
file item failed.java.io.IOException
- Reading the file item failed.public FileItemStream next() throws FileUploadException, java.io.IOException
FileItemStream
.next
in interface FileItemIterator
java.util.NoSuchElementException
- No more items are
available. Use hasNext()
to prevent this exception.FileUploadException
- Parsing or processing the
file item failed.java.io.IOException
- Reading the file item failed.