Package org.syncany.operations.restore

Examples of org.syncany.operations.restore.RestoreOperationResult


  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) {
View Full Code Here


  }
 
  @Override
  public int execute(String[] operationArgs) throws Exception {
    RestoreOperationOptions operationOptions = parseOptions(operationArgs);
    RestoreOperationResult operationResult = client.restore(operationOptions);
   
    printResults(operationResult);
   
    return 0;   
  }
View Full Code Here

    return operationOptions;
  }
 
  @Override
  public void printResults(OperationResult operationResult) {
    RestoreOperationResult concreteOperationResult = (RestoreOperationResult) operationResult;
   
    switch (concreteOperationResult.getResultCode()) {
    case ACK:
      out.println("File restored to " + concreteOperationResult.getTargetFile());
      break;
     
    case NACK_INVALID_FILE:
      out.println("Could not restore file. File entry is present but invalid (Folder?).");
      break;
     
    case NACK_NO_FILE:
      out.println("Could not restore file. No file by that ID or version found, or file ID prefix matches more than one file.");
      break;
     
    default:
      throw new RuntimeException("Invalid result code: " + concreteOperationResult.getResultCode())
    }
  }
View Full Code Here

TOP

Related Classes of org.syncany.operations.restore.RestoreOperationResult

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.