String keyPath = (String) s3KeyIter.next();
S3Object s3Object = (S3Object) s3ObjectsMap.get(keyPath);
if (disrepancyResults.onlyOnServerKeys.contains(keyPath)) {
printOutputLine("N " + keyPath, false);
DownloadPackage downloadPackage = ObjectUtils.createPackageForDownload(
s3Object, new File(localDirectory, keyPath), isGzipEnabled, isEncryptionEnabled, cryptoPassword);
if (downloadPackage != null) {
downloadPackagesList.add(downloadPackage);
}
} else if (disrepancyResults.updatedOnServerKeys.contains(keyPath)) {
printOutputLine("U " + keyPath, false);
DownloadPackage downloadPackage = ObjectUtils.createPackageForDownload(
s3Object, new File(localDirectory, keyPath), isGzipEnabled, isEncryptionEnabled, cryptoPassword);
if (downloadPackage != null) {
downloadPackagesList.add(downloadPackage);
}
} else if (disrepancyResults.alreadySynchronisedKeys.contains(keyPath)) {
if (isForce) {
printOutputLine("F " + keyPath, false);
DownloadPackage downloadPackage = ObjectUtils.createPackageForDownload(
s3Object, new File(localDirectory, keyPath), isGzipEnabled, isEncryptionEnabled, cryptoPassword);
if (downloadPackage != null) {
downloadPackagesList.add(downloadPackage);
}
} else {
printOutputLine("- " + keyPath, false);
}
} else if (disrepancyResults.updatedOnClientKeys.contains(keyPath)) {
// This file has been updated on the client-side.
if (isKeepFiles) {
printOutputLine("r " + keyPath, false);
} else {
printOutputLine("R " + keyPath, false);
DownloadPackage downloadPackage = ObjectUtils.createPackageForDownload(
s3Object, new File(localDirectory, keyPath), isGzipEnabled, isEncryptionEnabled, cryptoPassword);
if (downloadPackage != null) {
downloadPackagesList.add(downloadPackage);
}
}