Class MultipartStream.ProgressNotifier

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

public static class MultipartStream.ProgressNotifier extends Object
Internal class, which is used to invoke the ProgressListener.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private long
    Number of bytes, which have been read so far.
    private final long
    Number of expected bytes, if known, or -1.
    private int
    Number of items, which have been read so far.
    private final ProgressListener
    The listener to invoke.
  • Constructor Summary

    Constructors
    Constructor
    Description
    ProgressNotifier(ProgressListener listener, long contentLength)
    Creates a new instance with the given listener and content length.
  • Method Summary

    Modifier and Type
    Method
    Description
    (package private) void
    noteBytesRead(int count)
    Called to indicate that bytes have been read.
    (package private) void
    Called to indicate, that a new file item has been detected.
    private void
    Called for notifying the listener.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • 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 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.