From 99448d6c3b707d9e30f0836f22f36c4b6a76f3c2 Mon Sep 17 00:00:00 2001 From: felmer <felmer> Date: Mon, 4 Jan 2010 09:03:12 +0000 Subject: [PATCH] LMS-1267 refactoring out checkPathCopier SVN: 14122 --- .../filesystem/intf/AbstractFileStore.java | 33 +++---------------- 1 file changed, 4 insertions(+), 29 deletions(-) diff --git a/datamover/source/java/ch/systemsx/cisd/datamover/filesystem/intf/AbstractFileStore.java b/datamover/source/java/ch/systemsx/cisd/datamover/filesystem/intf/AbstractFileStore.java index 3f60dd7df89..a94c65daf7d 100644 --- a/datamover/source/java/ch/systemsx/cisd/datamover/filesystem/intf/AbstractFileStore.java +++ b/datamover/source/java/ch/systemsx/cisd/datamover/filesystem/intf/AbstractFileStore.java @@ -134,45 +134,20 @@ public abstract class AbstractFileStore implements IFileStore { if (srcHostOrNull != null) { - check(srcHostOrNull, factory.tryGetIncomingRsyncExecutable(), + String executable = factory.tryGetIncomingRsyncExecutable(); + FileUtilities.checkPathCopier(copier, srcHostOrNull, executable, tryGetRsyncModuleName(), DatamoverConstants.RSYNC_PASSWORD_FILE_INCOMING); } if (destHostOrNull != null) { - check(destHostOrNull, factory.tryGetOutgoingRsyncExecutable(), + String executable = factory.tryGetOutgoingRsyncExecutable(); + FileUtilities.checkPathCopier(copier, destHostOrNull, executable, destinationStore.tryGetRsyncModuleName(), DatamoverConstants.RSYNC_PASSWORD_FILE_OUTGOING); } } - private void check(String host, String remoteRsyncExecutable, - String rsyncModuleOrNull, String rsyncPasswordFileOrNull) - { - if (rsyncModuleOrNull != null) - { - final boolean connectionOK = - copier.checkRsyncConnectionViaRsyncServer(host, rsyncModuleOrNull, - rsyncPasswordFileOrNull); - if (connectionOK == false) - { - throw ConfigurationFailureException.fromTemplate( - "Connection to rsync module %s::%s failed", host, - rsyncModuleOrNull); - } - } else - { - final boolean connectionOK = - copier.checkRsyncConnectionViaSsh(host, remoteRsyncExecutable); - if (connectionOK == false) - { - throw ConfigurationFailureException.fromTemplate( - "No good rsync executable found on host '%s'", host); - } - } - - } - public boolean isRemote() { return srcHostOrNull != null || destHostOrNull != null; -- GitLab