From 7ea337c2ea02c7c8c248f44a2abb8aa6e330449c Mon Sep 17 00:00:00 2001 From: buczekp <buczekp> Date: Thu, 10 Mar 2011 14:20:09 +0000 Subject: [PATCH] [LMS-2106] improved RsyncArchiver to preserve original location hierarchy in the archive SVN: 20292 --- .../plugins/standard/RsyncDataSetCopier.java | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/datastore_server/source/java/ch/systemsx/cisd/openbis/dss/generic/server/plugins/standard/RsyncDataSetCopier.java b/datastore_server/source/java/ch/systemsx/cisd/openbis/dss/generic/server/plugins/standard/RsyncDataSetCopier.java index 30d20a25562..b1428d4fdb1 100644 --- a/datastore_server/source/java/ch/systemsx/cisd/openbis/dss/generic/server/plugins/standard/RsyncDataSetCopier.java +++ b/datastore_server/source/java/ch/systemsx/cisd/openbis/dss/generic/server/plugins/standard/RsyncDataSetCopier.java @@ -101,18 +101,18 @@ public class RsyncDataSetCopier } /** - * Copies specified data file/folder to destination specified in constructor. The name of the - * file/folder at the destination is defined by the given data set code. + * Copies specified data file/folder to destination specified in constructor. The path of the + * file/folder at the destination is defined by the original location of the data set. */ public Status copyToDestination(File originalData, DatasetDescription dataset) { try { - File destinationFolder = new File(destination, dataset.getDatasetCode()); + File destinationFolder = new File(destination, dataset.getDataSetLocation()); deleteDestinationFolder(destinationFolder); // cleanup needed for local executor operationLog.info("Copy dataset '" + dataset.getDatasetCode() + "' from '" - + originalData.getPath() + "' to '" + destination.getPath()); - executor.copyDataSetToDestination(originalData, destination); + + originalData.getPath() + "' to '" + destinationFolder.getParentFile()); + executor.copyDataSetToDestination(originalData, destinationFolder.getParentFile()); return Status.OK; } catch (ExceptionWithStatus ex) { @@ -121,18 +121,17 @@ public class RsyncDataSetCopier } /** - * Retrieves specified data file/folder from the destination specified in constructor. The name - * of the file/folder at the destination is defined by the given data set code. + * Retrieves specified data file/folder from the destination specified in constructor. The path + * at the destination is defined by original location of the data set. */ public Status retrieveFromDestination(File originalData, DatasetDescription dataset) { try { - File destinationFolder = new File(destination, dataset.getDatasetCode()); + File destinationFolder = new File(destination, dataset.getDataSetLocation()); checkDestinationExists(destinationFolder); operationLog.info("Retrieve data set '" + dataset.getDatasetCode() + "' from '" - + destinationFolder.getPath() + "' to '" - + originalData.getParentFile().getPath()); + + destinationFolder.getPath() + "' to '" + originalData.getParentFile()); executor.retrieveDataSetFromDestination(originalData.getParentFile(), destinationFolder); return Status.OK; } catch (ExceptionWithStatus ex) -- GitLab