Class FileUploadBase.FileItemIteratorImpl

    • Field Detail

      • multi

        private final MultipartStream multi
        The multi part stream to process.
      • boundary

        private final byte[] boundary
        The boundary, which separates the various parts.
      • currentFieldName

        private java.lang.String currentFieldName
        The current items field name.
      • skipPreamble

        private boolean skipPreamble
        Whether we are currently skipping the preamble.
      • itemValid

        private boolean itemValid
        Whether the current item may still be read.
      • eof

        private boolean eof
        Whether we have seen the end of the file.
    • Constructor Detail

      • FileItemIteratorImpl

        FileItemIteratorImpl​(RequestContext ctx)
                      throws FileUploadException,
                             java.io.IOException
        Creates a new instance.
        Parameters:
        ctx - The request context.
        Throws:
        FileUploadException - An error occurred while parsing the request.
        java.io.IOException - An I/O error occurred.
    • Method Detail

      • findNextItem

        private boolean findNextItem()
                              throws java.io.IOException
        Called for finding the next item, if any.
        Returns:
        True, if an next item was found, otherwise false.
        Throws:
        java.io.IOException - An I/O error occurred.
      • getContentLength

        private long getContentLength​(FileItemHeaders pHeaders)
      • hasNext

        public boolean hasNext()
                        throws FileUploadException,
                               java.io.IOException
        Returns, whether another instance of FileItemStream is available.
        Specified by:
        hasNext in interface FileItemIterator
        Returns:
        True, if one or more additional file items are available, otherwise false.
        Throws:
        FileUploadException - Parsing or processing the file item failed.
        java.io.IOException - Reading the file item failed.
      • next

        public FileItemStream next()
                            throws FileUploadException,
                                   java.io.IOException
        Returns the next available FileItemStream.
        Specified by:
        next in interface FileItemIterator
        Returns:
        FileItemStream instance, which provides access to the next file item.
        Throws:
        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.