Skip to content
Snippets Groups Projects
Commit facb4a7d authored by brinn's avatar brinn
Browse files

Fix copier not to call hostAwareFile.getLocalFile() if we work on a remote file.

SVN: 26519
parent 5f3a456d
No related branches found
No related tags found
No related merge requests found
...@@ -119,10 +119,10 @@ public class Copier implements Serializable, IPostRegistrationDatasetHandler ...@@ -119,10 +119,10 @@ public class Copier implements Serializable, IPostRegistrationDatasetHandler
FileUtilities.checkPathCopier(copier, host, null, rsyncModule, rsyncPasswordFile, FileUtilities.checkPathCopier(copier, host, null, rsyncModule, rsyncPasswordFile,
DataSetCopier.SSH_TIMEOUT_MILLIS); DataSetCopier.SSH_TIMEOUT_MILLIS);
} }
File destination = hostAwareFile.getLocalFile(); final String destination = hostAwareFile.getPath();
File destinationFile = new File(destination, originalData.getName()); final File destinationFile = new File(destination, originalData.getName());
String dataSetCode = dataSetInformation.getDataSetCode(); final String dataSetCode = dataSetInformation.getDataSetCode();
File finalDestinationFile = new File(destination, renameToDataSetCode ? dataSetCode : originalData.getName()); final File finalDestinationFile = new File(destination, renameToDataSetCode ? dataSetCode : originalData.getName());
BooleanStatus destinationExists = BooleanStatus destinationExists =
checkDestinationFileExistence(finalDestinationFile, host, sshCommandExecutor); checkDestinationFileExistence(finalDestinationFile, host, sshCommandExecutor);
...@@ -144,13 +144,12 @@ public class Copier implements Serializable, IPostRegistrationDatasetHandler ...@@ -144,13 +144,12 @@ public class Copier implements Serializable, IPostRegistrationDatasetHandler
IImmutableCopier hardLinkMaker = immutableCopierFactory.create(rsyncExecutable, IImmutableCopier hardLinkMaker = immutableCopierFactory.create(rsyncExecutable,
lnExecutable); lnExecutable);
status = status =
hardLinkMaker.copyImmutably(originalData, destination, hardLinkMaker.copyImmutably(originalData, new File(destination),
renameToDataSetCode ? dataSetCode : null); renameToDataSetCode ? dataSetCode : null);
} else } else
{ {
final String destinationRemotePath = hostAwareFile.getPath();
status = status =
copier.copyToRemote(originalData, destinationRemotePath, host, rsyncModule, copier.copyToRemote(originalData, destination, host, rsyncModule,
rsyncPasswordFile); rsyncPasswordFile);
} }
if (status.isError()) if (status.isError())
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment