Package org.apache.commons.fileupload
Class MultipartStream.ProgressNotifier
java.lang.Object
org.apache.commons.fileupload.MultipartStream.ProgressNotifier
- Enclosing class:
MultipartStream
Internal class, which is used to invoke the
ProgressListener.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate longNumber of bytes, which have been read so far.private final longNumber of expected bytes, if known, or -1.private intNumber of items, which have been read so far.private final ProgressListenerThe listener to invoke. -
Constructor Summary
ConstructorsConstructorDescriptionProgressNotifier(ProgressListener listener, long contentLength) Creates a new instance with the given listener and content length. -
Method Summary
Modifier and TypeMethodDescription(package private) voidnoteBytesRead(int count) Called to indicate that bytes have been read.(package private) voidnoteItem()Called to indicate, that a new file item has been detected.private voidCalled for notifying the listener.
-
Field Details
-
listener
The listener to invoke. -
contentLength
private final long contentLengthNumber of expected bytes, if known, or -1. -
bytesRead
private long bytesReadNumber of bytes, which have been read so far. -
items
private int itemsNumber of items, which have been read so far.
-
-
Constructor Details
-
ProgressNotifier
ProgressNotifier(ProgressListener listener, long contentLength) Creates a new instance with the given listener and content length.- Parameters:
listener- The listener to invoke.contentLength- The expected content length.
-
-
Method Details
-
noteBytesRead
void noteBytesRead(int count) Called to indicate that bytes have been read.- Parameters:
count- 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.
-