#ifdef HAS_SSH
#include "CommunicationProtocolSSH.hxx"
#endif
+#ifdef HAS_RSYNC
+ #include "CommunicationProtocolRsync.hxx"
+#endif
#include "APIInternalFailureException.hxx"
#include "RunTimeException.hxx"
#include "Log.hxx"
+#include "Utils.hxx"
using namespace std;
#else
throw RunTimeException("Can't use SSH protocol (SSH tools were "
"not found on the system at compile time).");
+#endif
+ } else if (protocolType == RSYNC) {
+#ifdef HAS_RSYNC
+ static CommunicationProtocolRsync instanceRsync;
+ return instanceRsync;
+#else
+ throw RunTimeException("Can't use RSYNC protocol (RSYNC tools were "
+ "not found on the system at compile time).");
#endif
} else
throw APIInternalFailureException("Unknown communication protocol.");
// if the argument contains spaces, we surround it with simple quotes (Linux)
// or double quotes (Windows)
- if (commandArgs[i].find(' ') != string::npos) {
+ if (commandArgs[i].find(' ') != string::npos &&
+ !Utils::isOption(commandArgs[i])){
commandStr += string("\"") + commandArgs[i] + "\"";
} else {
commandStr += commandArgs[i];