Class LogProgressCallback
java.lang.Object
com.amilesend.onedrive.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 classstatic enumDescribes that transfer type used for logging progress. -
Method Summary
Modifier and TypeMethodDescriptionbuilder()static StringformatPrefix(String source, String destination) Helper method to format the logging prefix to use.voidonComplete(long bytesTransferred) Callback to notify consumers of a completed transfer.voidCallback to notify consumers of a failure during a transfer.voidonUpdate(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:TransferProgressCallbackCallback to notify consumers of the current amount of bytes that have transferred.- Specified by:
onUpdatein 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:TransferProgressCallbackCallback to notify consumers of a failure during a transfer.- Specified by:
onFailurein interfaceTransferProgressCallback- Parameters:
cause- the cause of the failure
-
onComplete
public void onComplete(long bytesTransferred) Description copied from interface:TransferProgressCallbackCallback to notify consumers of a completed transfer.- Specified by:
onCompletein interfaceTransferProgressCallback- Parameters:
bytesTransferred- the total bytes transfered
-
builder
-