Package org.syncany.operations.up

Examples of org.syncany.operations.up.UpOperationOptions


    TestClient clientB = new TestClient("B", testConnection);

    StatusOperationOptions forceChecksumStatusOperationOptions = new StatusOperationOptions();
    forceChecksumStatusOperationOptions.setForceChecksum(true);

    UpOperationOptions noCleanupAndForceUpOperationOptions = new UpOperationOptions();
    noCleanupAndForceUpOperationOptions.setForceUploadEnabled(true);
    noCleanupAndForceUpOperationOptions.setStatusOptions(forceChecksumStatusOperationOptions);

    // Run

    // 1. Call A.up(); this fails AFTER the first multichunk
    clientA.createNewFile("A-file1", 5 * 1024 * 1024);
 
View Full Code Here


    TransferSettings testConnection = TestConfigUtil.createTestLocalConnection();
   
    TestClient clientA = new TestClient("A", testConnection);
    TestClient clientB = new TestClient("B", testConnection);
   
    UpOperationOptions forceUpOperationOptions = new UpOperationOptions();
    forceUpOperationOptions.setForceUploadEnabled(true);
   
    // Run
    clientA.createNewFile("A-file1.jpg", 1*1024*1024);
    clientA.up(forceUpOperationOptions)
   
 
View Full Code Here

  public Config getConfig() {
    return config;
  }

  public UpOperationResult up() throws Exception {
    return up(new UpOperationOptions());
  }
View Full Code Here

    TransferSettings testConnection = TestConfigUtil.createTestLocalConnection();   
    TestClient clientA = new TestClient("A", testConnection);
    TestClient clientB = new TestClient("B", testConnection);
    TestClient clientC = new TestClient("C", testConnection);

    UpOperationOptions cUpOptionsWithForce = new UpOperationOptions();
    cUpOptionsWithForce.setForceUploadEnabled(true);
   
    // Run
    clientA.createNewFile("file1.jpg");
    clientA.upWithForceChecksum();
   
View Full Code Here

    // Setup
    LocalTransferSettings testConnection = (LocalTransferSettings) TestConfigUtil.createTestLocalConnection();   
    TestClient clientA = new TestClient("A", testConnection);
    TestClient clientB = new TestClient("B", testConnection);

    UpOperationOptions upOptionsWithForce = new UpOperationOptions();
    upOptionsWithForce.setForceUploadEnabled(true);
   
    // Run
    clientA.createNewFile("file1.jpg");
    clientA.up();
   
View Full Code Here

    // Setup
    LocalTransferSettings testConnection = (LocalTransferSettings) TestConfigUtil.createTestLocalConnection();   
    TestClient clientA = new TestClient("A", testConnection);
    TestClient clientB = new TestClient("B", testConnection);

    UpOperationOptions upOptionsWithForce = new UpOperationOptions();
    upOptionsWithForce.setForceUploadEnabled(true);
   
    // Run
   
    // Round 1
    clientA.createNewFile("file1.jpg");
View Full Code Here

    File testFile = TestFileUtil.createRandomFileInDirectory(config.getLocalDir(), 40);
   
    StatusOperationOptions statusOptions = new StatusOperationOptions();
    statusOptions.setForceChecksum(true);

    UpOperationOptions syncUpOptions = new UpOperationOptions();
    syncUpOptions.setStatusOptions(statusOptions);     
   
    // Perform 'up' and immediately change test file
    // IMPORTANT: Do NOT sleep to enforce checksum-based comparison in 'status'
    new UpOperation(config, syncUpOptions).execute();   
    TestFileUtil.changeRandomPartOfBinaryFile(testFile);
View Full Code Here

 
  public UpOperationResult upWithForceChecksum() throws Exception {
    StatusOperationOptions statusOptions = new StatusOperationOptions();
    statusOptions.setForceChecksum(true);
   
    UpOperationOptions upOptions = new UpOperationOptions();
    upOptions.setStatusOptions(statusOptions);
   
    return up(upOptions);
  }
View Full Code Here

    return false;
  }
 
  @Override
  public int execute(String[] operationArgs) throws Exception {
    UpOperationOptions operationOptions = parseOptions(operationArgs);
    UpOperationResult operationResult = client.up(operationOptions);

    printResults(operationResult);

    return 0;
View Full Code Here

    return 0;
  }

  @Override
  public UpOperationOptions parseOptions(String[] operationArgs) throws Exception {
    UpOperationOptions operationOptions = new UpOperationOptions();

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

    OptionSpec<Void> optionForceUpload = parser.acceptsAll(asList("F", "force-upload"));

    OptionSet options = parser.parse(operationArgs);

    // status [<args>]
    operationOptions.setStatusOptions(parseStatusOptions(operationArgs));

    // --force
    operationOptions.setForceUploadEnabled(options.has(optionForceUpload));

    return operationOptions;
  }
View Full Code Here

TOP

Related Classes of org.syncany.operations.up.UpOperationOptions

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.