Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -354,9 +354,17 @@ protected Answer copyFromSwiftToNfs(CopyCommand cmd, DataTO srcData, SwiftTO swi
try {
String downloadPath = determineStorageTemplatePath(storagePath, destPath);
final File downloadDirectory = _storage.getFile(downloadPath);
if (!downloadDirectory.mkdirs()) {
return new CopyCmdAnswer("Failed to create download directory " + downloadPath);

if (downloadDirectory.exists()) {
s_logger.debug("Directory " + downloadPath + " already exists");
} else {
if (!downloadDirectory.mkdirs()) {
final String errMsg = "Unable to create directory " + downloadPath + " to copy from Swift to cache.";
s_logger.error(errMsg);
return new CopyCmdAnswer(errMsg);
}
}

File destFile = SwiftUtil.getObject(swiftTO, downloadDirectory, srcData.getPath());
return postProcessing(destFile, downloadPath, destPath, srcData, destData);
} catch (Exception e) {
Expand Down