use of org.syncany.operations.restore.RestoreOperation in project syncany by syncany.
the class RestoreCommand method execute.
@Override
public int execute(String[] operationArgs) throws Exception {
RestoreOperationOptions operationOptions = parseOptions(operationArgs);
RestoreOperationResult operationResult = new RestoreOperation(config, operationOptions).execute();
printResults(operationResult);
return 0;
}
use of org.syncany.operations.restore.RestoreOperation in project syncany by syncany.
the class RestoreFolderRequestHandler method handleRequest.
@Override
public Response handleRequest(FolderRequest request) {
RestoreFolderRequest concreteRequest = (RestoreFolderRequest) request;
try {
RestoreOperation operation = new RestoreOperation(config, concreteRequest.getOptions());
RestoreOperationResult operationResult = operation.execute();
RestoreFolderResponse response = new RestoreFolderResponse(operationResult, request.getId());
return response;
} catch (Exception e) {
logger.log(Level.WARNING, "Cannot obtain status.", e);
return new BadRequestResponse(request.getId(), "Cannot execute operation: " + e.getMessage());
}
}
Aggregations