try {
final File tempDest = new File(tempDir, finalDestFile.getName());
{
SshOpsTarget srcSshOpsTarget = (SshOpsTarget) src;
String sshSrc = srcSshOpsTarget.getUsername() + "@";
InetAddress srcHost = srcSshOpsTarget.getHost();
if (InetAddressUtils.isIpv6(srcHost)) {
sshSrc += "[" + InetAddresses.toAddrString(srcHost) + "]";
} else {
sshSrc += InetAddresses.toAddrString(srcHost);
}
sshSrc += ":" + srcFile.getAbsolutePath();
Command pullCommand = Command.build("scp -o StrictHostKeyChecking=no {0} {1}", sshSrc, tempDest);
pullCommand.setKeyPair(srcSshOpsTarget.getKeyPair());
dest.executeCommand(pullCommand.setTimeout(TimeSpan.TEN_MINUTES));
Md5Hash targetHash = dest.getFileHash(tempDest);
Md5Hash srcHash = src.getFileHash(srcFile);