use of org.syncany.config.to.FolderTO in project syncany by syncany.
the class WatchServer method startWatchOperations.
private void startWatchOperations(Map<File, FolderTO> newWatchedFolderTOs) throws ConfigException, ServiceAlreadyStartedException {
for (Map.Entry<File, FolderTO> folderEntry : newWatchedFolderTOs.entrySet()) {
File localDir = folderEntry.getKey();
try {
Config watchConfig = ConfigHelper.loadConfig(localDir);
if (watchConfig != null) {
logger.log(Level.INFO, "- Starting watch operation at " + localDir + " ...");
WatchOperationOptions watchOptions = folderEntry.getValue().getWatchOptions();
if (watchOptions == null) {
watchOptions = new WatchOperationOptions();
}
WatchRunner watchRunner = new WatchRunner(watchConfig, watchOptions, daemonConfig.getPortTO());
watchRunner.start();
watchOperations.put(localDir, watchRunner);
} else {
logger.log(Level.INFO, "- CANNOT start watch, because no config found at " + localDir + " ...");
}
} catch (Exception e) {
logger.log(Level.SEVERE, " + Cannot start watch operation at " + localDir + ". IGNORING.", e);
}
}
}
use of org.syncany.config.to.FolderTO in project syncany by syncany.
the class DaemonOperationResultTest method setUp.
@Before
public void setUp() {
folder = new FolderTO("test");
watchList = new ArrayList<FolderTO>();
watchList.add(folder);
result = new DaemonOperationResult(DaemonResultCode.OK, watchList);
}
Aggregations