Package org.apache.commons.fileupload
Class MultipartStream.ProgressNotifier
- java.lang.Object
-
- org.apache.commons.fileupload.MultipartStream.ProgressNotifier
-
- Enclosing class:
- MultipartStream
public static class MultipartStream.ProgressNotifier extends java.lang.ObjectInternal class, which is used to invoke theProgressListener.
-
-
Field Summary
Fields Modifier and Type Field Description private longbytesReadNumber of bytes, which have been read so far.private longcontentLengthNumber of expected bytes, if known, or -1.private intitemsNumber of items, which have been read so far.private ProgressListenerlistenerThe listener to invoke.
-
Constructor Summary
Constructors Constructor Description ProgressNotifier(ProgressListener pListener, long pContentLength)Creates a new instance with the given listener and content length.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) voidnoteBytesRead(int pBytes)Called to indicate that bytes have been read.(package private) voidnoteItem()Called to indicate, that a new file item has been detected.private voidnotifyListener()Called for notifying the listener.
-
-
-
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
-
ProgressNotifier
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.
-
-