use of org.syncany.operations.daemon.messages.StatusEndSyncExternalEvent in project syncany by syncany.
the class StatusOperation method execute.
@Override
public StatusOperationResult execute() throws Exception {
logger.log(Level.INFO, "");
logger.log(Level.INFO, "Running 'Status' at client " + config.getMachineName() + " ...");
logger.log(Level.INFO, "--------------------------------------------");
if (options != null && options.isForceChecksum()) {
logger.log(Level.INFO, "Force checksum ENABLED.");
}
if (options != null && !options.isDelete()) {
logger.log(Level.INFO, "Delete missing files DISABLED.");
}
// Get local database
logger.log(Level.INFO, "Querying current file tree from database ...");
eventBus.post(new StatusStartSyncExternalEvent(config.getLocalDir().getAbsolutePath()));
// Path to actual file version
final Map<String, FileVersion> filesInDatabase = localDatabase.getCurrentFileTree();
// Find local changes
logger.log(Level.INFO, "Analyzing local folder " + config.getLocalDir() + " ...");
ChangeSet localChanges = findLocalChanges(filesInDatabase);
if (!localChanges.hasChanges()) {
logger.log(Level.INFO, "- No changes to local database");
}
// Return result
StatusOperationResult statusResult = new StatusOperationResult();
statusResult.setChangeSet(localChanges);
eventBus.post(new StatusEndSyncExternalEvent(config.getLocalDir().getAbsolutePath(), localChanges.hasChanges()));
return statusResult;
}
Aggregations