All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.hidetake.groovy.ssh.operation.SftpProgress.groovy Maven / Gradle / Ivy

There is a newer version: 2.11.2
Show newest version
package org.hidetake.groovy.ssh.operation

import com.jcraft.jsch.SftpProgressMonitor
import groovy.transform.CompileStatic
import org.hidetake.groovy.ssh.util.FileTransferProgress

/**
 * A bridge class between {@link SftpProgressMonitor} and {@link FileTransferProgress}.
 *
 * Use {@link CompileStatic} to prevent {@link IncompatibleClassChangeError} on Gradle 1.x.
 *
 * @author Hidetake Iwata
 */
@CompileStatic
class SftpProgress extends FileTransferProgress implements SftpProgressMonitor {

    def SftpProgress(Closure notifier) {
        super(notifier)
    }

    @Override
    void init(int op, String src, String dest, long max) {
        reset(max)
    }

    @Override
    boolean count(long count) {
        report(count)
        true
    }

    @Override
    void end() {
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy