Search in sources :

Example 1 with RestoreOperationResult

use of org.syncany.operations.restore.RestoreOperationResult 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;
}
Also used : RestoreOperationOptions(org.syncany.operations.restore.RestoreOperationOptions) RestoreOperationResult(org.syncany.operations.restore.RestoreOperationResult) RestoreOperation(org.syncany.operations.restore.RestoreOperation)

Example 2 with RestoreOperationResult

use of org.syncany.operations.restore.RestoreOperationResult 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());
    }
}
Also used : RestoreOperationResult(org.syncany.operations.restore.RestoreOperationResult) RestoreOperation(org.syncany.operations.restore.RestoreOperation)

Aggregations

RestoreOperation (org.syncany.operations.restore.RestoreOperation)2 RestoreOperationResult (org.syncany.operations.restore.RestoreOperationResult)2 RestoreOperationOptions (org.syncany.operations.restore.RestoreOperationOptions)1