Class LogProgressCallback

java.lang.Object
com.amilesend.client.connection.file.LogProgressCallback
All Implemented Interfaces:
TransferProgressCallback

public class LogProgressCallback extends Object implements TransferProgressCallback
A log-based implementation of TransferProgressCallback that logs transfer progress.
See Also:
  • Method Details

    • formatPrefix

      public static String formatPrefix(String source, String destination)
      Helper method to format the logging prefix to use.
      Parameters:
      source - the source
      destination - the destination
      Returns:
      the logging prefix
    • onUpdate

      public void onUpdate(long currentBytes, long totalBytes)
      Description copied from interface: TransferProgressCallback
      Callback to notify consumers of the current amount of bytes that have transferred.
      Specified by:
      onUpdate in interface TransferProgressCallback
      Parameters:
      currentBytes - the current amount of accumulative bytes transferred thus far
      totalBytes - the total amount of bytes for the transfer
    • onFailure

      public void onFailure(Throwable cause)
      Description copied from interface: TransferProgressCallback
      Callback to notify consumers of a failure during a transfer.
      Specified by:
      onFailure in interface TransferProgressCallback
      Parameters:
      cause - the cause of the failure
    • onComplete

      public void onComplete(long bytesTransferred)
      Description copied from interface: TransferProgressCallback
      Callback to notify consumers of a completed transfer.
      Specified by:
      onComplete in interface TransferProgressCallback
      Parameters:
      bytesTransferred - the total bytes transfered
    • builder