use of org.syncany.operations.log.LogOperationResult in project syncany by syncany.
the class LogCommand method printResults.
@Override
public void printResults(OperationResult operationResult) {
LogOperationResult concreteOperationResult = (LogOperationResult) operationResult;
List<LightweightDatabaseVersion> databaseVersions = concreteOperationResult.getDatabaseVersions();
Collections.reverse(databaseVersions);
for (LightweightDatabaseVersion databaseVersion : databaseVersions) {
boolean hasChanges = databaseVersion.getChangeSet().hasChanges();
boolean printDatabaseVersion = hasChanges || !excludeEmpty;
if (printDatabaseVersion) {
printDatabaseVersion(databaseVersion);
}
}
}
use of org.syncany.operations.log.LogOperationResult in project syncany by syncany.
the class LogCommand method execute.
@Override
public int execute(String[] operationArgs) throws Exception {
LogOperationOptions operationOptions = parseOptions(operationArgs);
LogOperationResult operationResult = new LogOperation(config, operationOptions).execute();
printResults(operationResult);
return 0;
}
use of org.syncany.operations.log.LogOperationResult in project syncany by syncany.
the class LogFolderRequestHandler method handleRequest.
@Override
public Response handleRequest(FolderRequest request) {
LogFolderRequest concreteRequest = (LogFolderRequest) request;
try {
LogOperation operation = new LogOperation(config, concreteRequest.getOptions());
LogOperationResult operationResult = operation.execute();
LogFolderResponse response = new LogFolderResponse(operationResult, request.getId(), request.getRoot());
return response;
} catch (Exception e) {
logger.log(Level.WARNING, "Cannot obtain status.", e);
return new BadRequestResponse(request.getId(), "Cannot execute operation: " + e.getMessage());
}
}
Aggregations