Class LogProgressCallback
java.lang.Object
com.amilesend.client.connection.file.LogProgressCallback
- All Implemented Interfaces:
TransferProgressCallback
A log-based implementation of
TransferProgressCallback
that logs transfer progress.- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
static enum
Describes that transfer type used for logging progress. -
Method Summary
Modifier and TypeMethodDescriptionbuilder()
static String
formatPrefix
(String source, String destination) Helper method to format the logging prefix to use.void
onComplete
(long bytesTransferred) Callback to notify consumers of a completed transfer.void
Callback to notify consumers of a failure during a transfer.void
onUpdate
(long currentBytes, long totalBytes) Callback to notify consumers of the current amount of bytes that have transferred.
-
Method Details
-
formatPrefix
Helper method to format the logging prefix to use.- Parameters:
source
- the sourcedestination
- 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 interfaceTransferProgressCallback
- Parameters:
currentBytes
- the current amount of accumulative bytes transferred thus fartotalBytes
- the total amount of bytes for the transfer
-
onFailure
Description copied from interface:TransferProgressCallback
Callback to notify consumers of a failure during a transfer.- Specified by:
onFailure
in interfaceTransferProgressCallback
- 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 interfaceTransferProgressCallback
- Parameters:
bytesTransferred
- the total bytes transfered
-
builder
-