private void startCopy(String sourcePath, LocalDestFile targetFile, ScpCommandLine.EscapeMode escapeMode) throws IOException { ScpCommandLine commandLine = ScpCommandLine.with(ScpCommandLine.Arg.SOURCE) .and(ScpCommandLine.Arg.QUIET) .and(ScpCommandLine.Arg.PRESERVE_TIMES) .and(ScpCommandLine.Arg.RECURSIVE, recursiveMode) .and(ScpCommandLine.Arg.LIMIT, String.valueOf(bandwidthLimit), (bandwidthLimit > 0)); commandLine.withPath(sourcePath, escapeMode); engine.execSCPWith(commandLine); engine.signal("Start status OK"); String msg = engine.readMessage(); do { process(engine.getTransferListener(), null, msg, targetFile); } while (!(msg = engine.readMessage()).isEmpty()); }
private void startCopy(LocalSourceFile sourceFile, String targetPath, ScpCommandLine.EscapeMode escapeMode) throws IOException { ScpCommandLine commandLine = ScpCommandLine.with(ScpCommandLine.Arg.SINK) .and(ScpCommandLine.Arg.RECURSIVE) .and(ScpCommandLine.Arg.PRESERVE_TIMES, sourceFile.providesAtimeMtime()) .and(ScpCommandLine.Arg.LIMIT, String.valueOf(bandwidthLimit), (bandwidthLimit > 0)); commandLine.withPath(targetPath, escapeMode); engine.execSCPWith(commandLine); engine.check("Start status OK"); process(engine.getTransferListener(), sourceFile); }
private void startCopy(String sourcePath, LocalDestFile targetFile, ScpCommandLine.EscapeMode escapeMode) throws IOException { ScpCommandLine commandLine = ScpCommandLine.with(ScpCommandLine.Arg.SOURCE) .and(ScpCommandLine.Arg.QUIET) .and(ScpCommandLine.Arg.PRESERVE_TIMES) .and(ScpCommandLine.Arg.RECURSIVE, recursiveMode) .and(ScpCommandLine.Arg.LIMIT, String.valueOf(bandwidthLimit), (bandwidthLimit > 0)); commandLine.withPath(sourcePath, escapeMode); engine.execSCPWith(commandLine); engine.signal("Start status OK"); String msg = engine.readMessage(); do { process(engine.getTransferListener(), null, msg, targetFile); } while (!(msg = engine.readMessage()).isEmpty()); }
private void startCopy(LocalSourceFile sourceFile, String targetPath, ScpCommandLine.EscapeMode escapeMode) throws IOException { ScpCommandLine commandLine = ScpCommandLine.with(ScpCommandLine.Arg.SINK) .and(ScpCommandLine.Arg.RECURSIVE) .and(ScpCommandLine.Arg.PRESERVE_TIMES, sourceFile.providesAtimeMtime()) .and(ScpCommandLine.Arg.LIMIT, String.valueOf(bandwidthLimit), (bandwidthLimit > 0)); commandLine.withPath(targetPath, escapeMode); engine.execSCPWith(commandLine); engine.check("Start status OK"); process(engine.getTransferListener(), sourceFile); }