*/
public void restoreToLocalDirectory(Map<String, String> objectKeyToFilepathMap,
String rootObjectPath, File localDirectory, StorageBucket bucket,
BytesProgressWatcher md5GenerationProgressWatcher) throws Exception
{
FileComparerResults mergedDiscrepancyResults = new FileComparerResults();
String priorLastKey = null;
// Store local path mapped to storage object for moved objects.
Map<String, StorageObject> objectsMoved = new HashMap<String, StorageObject>();
// Repeat download actions until all objects in bucket have been listed.
do {
ComparisonResult result =
compareLocalAndRemoteFiles(mergedDiscrepancyResults, bucket.getName(),
rootObjectPath, priorLastKey, objectKeyToFilepathMap,
md5GenerationProgressWatcher);
priorLastKey = result.priorLastKey;
FileComparerResults discrepancyResults = result.discrepancyResults;
Map<String, StorageObject> objectsMap = result.objectsMap;
// Download objects to local files/directories.
Iterator<String> objectKeyIter = objectsMap.keySet().iterator();