Transfer Event
Fired during file download/upload.
Syntax
public open class DefaultSshplexEventListener : SshplexEventListener { ... public override fun transfer(e: SshplexTransferEvent) {} ... } public class SshplexTransferEvent { val operationId: String? val direction: Int val localFile: String? val remoteFile: String? val remotePath: String? val bytesTransferred: Long val percentDone: Int val text: ByteArray? var cancel: Boolean }
Remarks
This event is fired once per file when it starts downloading/uploading.
OperationId is associated with the operation that fired this event. Direction is 0 for Uploads and 1 for Downloads. LocalFile, RemoteFile, and RemotePath are populated with values of LocalFile, RemoteFile, and RemotePath, respectively, that are associated with the operation that fired this event.
BytesTransferred shows the number of bytes transferred since the beginning of the transfer, and PercentDone contains the percentage (0-100) of bytes transferred based on the Direction being transferred. If PercentDone cannot be calculated the value will be -1.
Text contains the text of the file being transferred.
Setting Cancel to true will cancel the associated operation without firing a DownloadComplete or UploadComplete event. It is not equivalent to calling CancelOperation with the associated OperationId, which will fire the aforementioned events.