public final class LoggingTransferListener extends Object implements TransferListener
TransferListener that logs a progress bar at the INFO level. This implementation
effectively rate-limits how frequently updates are logged by only logging when a new "tick" advances in the progress bar. By
default, the progress bar has ticks, meaning an update is only logged, at most, once every 5%.TransferListener.Context| Modifier and Type | Method and Description |
|---|---|
void |
bytesTransferred(TransferListener.Context.BytesTransferred context)
Additional bytes have been submitted or received.
|
static LoggingTransferListener |
create()
Create an instance of
LoggingTransferListener with the default configuration. |
static LoggingTransferListener |
create(int maxTicks)
Create an instance of
LoggingTransferListener with a custom maxTicks value. |
void |
transferComplete(TransferListener.Context.TransferComplete context)
The transfer has completed successfully.
|
void |
transferFailed(TransferListener.Context.TransferFailed context)
The transfer failed.
|
void |
transferInitiated(TransferListener.Context.TransferInitiated context)
A new transfer has been initiated.
|
public static LoggingTransferListener create(int maxTicks)
LoggingTransferListener with a custom maxTicks value.maxTicks - the number of ticks in the logged progress barpublic static LoggingTransferListener create()
LoggingTransferListener with the default configuration.public void transferInitiated(TransferListener.Context.TransferInitiated context)
TransferListenerAvailable context attributes:
transferInitiated in interface TransferListenerpublic void bytesTransferred(TransferListener.Context.BytesTransferred context)
TransferListenerAvailable context attributes:
bytesTransferred in interface TransferListenerpublic void transferComplete(TransferListener.Context.TransferComplete context)
TransferListenerAvailable context attributes:
transferComplete in interface TransferListenerpublic void transferFailed(TransferListener.Context.TransferFailed context)
TransferListenerAvailable context attributes:
transferFailed in interface TransferListenerCopyright © 2023. All rights reserved.