Skip to content
Snippets Groups Projects
Commit 99448d6c authored by felmer's avatar felmer
Browse files

LMS-1267 refactoring out checkPathCopier

SVN: 14122
parent 87b0c11c
No related branches found
No related tags found
No related merge requests found
......@@ -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;
......
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