Package org.syncany.operations.down

Examples of org.syncany.operations.down.DownOperationOptions


  public UpOperationResult up(UpOperationOptions options) throws Exception {
    return new UpOperation(config, options).execute();
  }

  public DownOperationResult down() throws Exception {
    return down(new DownOperationOptions());
  }
View Full Code Here


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

   
    return 0;
  }

  public DownOperationOptions parseOptions(String[] operationArguments) {
    DownOperationOptions operationOptions = new DownOperationOptions();

    OptionParser parser = new OptionParser();
    parser.allowsUnrecognizedOptions();

    OptionSpec<String> optionConflictStrategy = parser.acceptsAll(asList("C", "conflict-strategy")).withRequiredArg();
    OptionSpec<Void> optionNoApply = parser.acceptsAll(asList("A", "no-apply"));

    OptionSet options = parser.parse(operationArguments);

    // --conflict-strategy=<strategy>
    if (options.has(optionConflictStrategy)) {
      String conflictStrategyStr = options.valueOf(optionConflictStrategy).toUpperCase();
      operationOptions.setConflictStrategy(DownConflictStrategy.valueOf(conflictStrategyStr));
    }
   
    // --no-apply
    if (options.has(optionNoApply)) {
      operationOptions.setApplyChanges(false);
    }

    return operationOptions;
  }
View Full Code Here

TOP

Related Classes of org.syncany.operations.down.DownOperationOptions

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.