org.apache.commons.fileupload
Class MultipartStream.ProgressNotifier

java.lang.Object
  extended by org.apache.commons.fileupload.MultipartStream.ProgressNotifier
Enclosing class:
MultipartStream

static class MultipartStream.ProgressNotifier
extends java.lang.Object

Internal class, which is used to invoke the ProgressListener.


Field Summary
private  long bytesRead
          Number of bytes, which have been read so far.
private  long contentLength
          Number of expected bytes, if known, or -1.
private  int items
          Number of items, which have been read so far.
private  ProgressListener listener
          The listener to invoke.
 
Constructor Summary
MultipartStream.ProgressNotifier(ProgressListener pListener, long pContentLength)
          Creates a new instance with the given listener and content length.
 
Method Summary
(package private)  void noteBytesRead(int pBytes)
          Called to indicate that bytes have been read.
(package private)  void noteItem()
          Called to indicate, that a new file item has been detected.
private  void notifyListener()
          Called for notifying the listener.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

listener

private final ProgressListener listener
The listener to invoke.


contentLength

private final long contentLength
Number of expected bytes, if known, or -1.


bytesRead

private long bytesRead
Number of bytes, which have been read so far.


items

private int items
Number of items, which have been read so far.

Constructor Detail

MultipartStream.ProgressNotifier

MultipartStream.ProgressNotifier(ProgressListener pListener,
                                 long pContentLength)
Creates a new instance with the given listener and content length.

Parameters:
pListener - The listener to invoke.
pContentLength - The expected content length.
Method Detail

noteBytesRead

void noteBytesRead(int pBytes)
Called to indicate that bytes have been read.

Parameters:
pBytes - Number of bytes, which have been read.

noteItem

void noteItem()
Called to indicate, that a new file item has been detected.


notifyListener

private void notifyListener()
Called for notifying the listener.