Package org.syncany.operations.cleanup

Examples of org.syncany.operations.cleanup.CleanupOperationOptions


    TestClient clientA = new TestClient("A", testConnection);
    TestClient clientB = new TestClient("B", testConnection);
    TestClient clientC = new TestClient("C", testConnection);

    CleanupOperationOptions cleanupOptionsOnlyMergeDatabases = new CleanupOperationOptions();
    cleanupOptionsOnlyMergeDatabases.setMergeRemoteFiles(true);
    cleanupOptionsOnlyMergeDatabases.setRemoveOldVersions(false);

    UpOperationOptions upOperationOptionsNoCleanup = new UpOperationOptions();
    upOperationOptionsNoCleanup.setForceUploadEnabled(true);

    // Run preparations
View Full Code Here


    TestClient clientC = new TestClient("C", testConnection);

    java.sql.Connection databaseConnectionA = DatabaseConnectionFactory.createConnection(clientA.getDatabaseFile());
    java.sql.Connection databaseConnectionB = DatabaseConnectionFactory.createConnection(clientB.getDatabaseFile());

    CleanupOperationOptions options = new CleanupOperationOptions();
    options.setMergeRemoteFiles(true);
    options.setRemoveOldVersions(true);
    options.setKeepVersionsCount(5);
    options.setMinSecondsBetweenCleanups(0);
    options.setMaxDatabaseFiles(7);

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

    UpOperationOptions upOperationOptionsWithCleanupForce = new UpOperationOptions();
View Full Code Here

    TestClient clientA = new TestClient("A", testConnection);
    TestClient clientB = new TestClient("B", testConnection);
    TestClient clientC = new TestClient("C", testConnection);

    CleanupOperationOptions cleanupOptionsKeep1 = new CleanupOperationOptions();
    cleanupOptionsKeep1.setMergeRemoteFiles(true);
    cleanupOptionsKeep1.setRemoveOldVersions(true);
    cleanupOptionsKeep1.setKeepVersionsCount(1);

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

    UpOperationOptions upNoCleanupForceChecksum = new UpOperationOptions();
View Full Code Here

    TestClient clientA = new TestClient("A", testConnection);
    TestClient clientB = new TestClient("B", testConnection);
    TestClient clientC = new TestClient("C", testConnection);

    CleanupOperationOptions cleanupOptionsKeep1 = new CleanupOperationOptions();
    cleanupOptionsKeep1.setMergeRemoteFiles(true);
    cleanupOptionsKeep1.setRemoveOldVersions(true);
    cleanupOptionsKeep1.setKeepVersionsCount(1);

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

    UpOperationOptions upNoCleanupForceChecksum = new UpOperationOptions();
    upNoCleanupForceChecksum.setStatusOptions(statusOptionsForceChecksum);

    UpOperationOptions upWithCleanupKeep1ForceChecksum = new UpOperationOptions();
    upWithCleanupKeep1ForceChecksum.setStatusOptions(statusOptionsForceChecksum);

    clientB.createNewFile("fileB");
    clientB.up(upNoCleanupForceChecksum);

    clientA.down();
    TestFileUtil.copyFile(clientB.getLocalFile("fileB"), clientA.getLocalFile("fileBcopy"));
    clientA.up(upNoCleanupForceChecksum);

    for (int i = 0; i < 30; i++) {
      clientB.down();
      clientB.changeFile("fileB");
      clientB.up(upNoCleanupForceChecksum);
    }

    FileUtils.copyDirectory(testConnection.getPath(), new File(testConnection.getPath() + "_1_before_cleanup"));
    FileUtils.copyDirectory(clientB.getConfig().getDatabaseDir(), new File(clientB.getConfig().getAppDir(), "1_before_cleanup"));

    CleanupOperationOptions cleanupMergeAndRemoveOldFiles = new CleanupOperationOptions();
    cleanupMergeAndRemoveOldFiles.setMergeRemoteFiles(true);
    cleanupMergeAndRemoveOldFiles.setRemoveOldVersions(true);
    clientB.cleanup(cleanupMergeAndRemoveOldFiles);

    FileUtils.copyDirectory(testConnection.getPath(), new File(testConnection.getPath() + "_2_after_cleanup"));
    FileUtils.copyDirectory(clientB.getConfig().getDatabaseDir(), new File(clientB.getConfig().getAppDir(), "2_after_cleanup"));
View Full Code Here

    TestClient clientB = new TestClient("B", testConnection);
    TestClient clientC = new TestClient("C", testConnection);
    TestClient clientD = new TestClient("D", testConnection);
    TestClient clientE = new TestClient("E", testConnection);

    CleanupOperationOptions cleanupOptionsKeep1 = new CleanupOperationOptions();
    cleanupOptionsKeep1.setMergeRemoteFiles(true);
    cleanupOptionsKeep1.setRemoveOldVersions(true);
    cleanupOptionsKeep1.setKeepVersionsCount(1);

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

    UpOperationOptions upNoCleanupForceChecksum = new UpOperationOptions();
    upNoCleanupForceChecksum.setStatusOptions(statusOptionsForceChecksum);

    UpOperationOptions upWithCleanupKeep1ForceChecksum = new UpOperationOptions();
    upWithCleanupKeep1ForceChecksum.setStatusOptions(statusOptionsForceChecksum);

    // First round

    clientB.createNewFile("fileA");
    clientB.up(upNoCleanupForceChecksum);

    clientA.down();
    TestFileUtil.copyFile(clientA.getLocalFile("fileA"), clientA.getLocalFile("fileAcopy"));
    clientA.up(upNoCleanupForceChecksum);

    clientA.down();

    for (int i = 0; i < 30; i++) {
      clientA.down();
      clientA.changeFile("fileA");
      clientA.up(upNoCleanupForceChecksum);
    }

    // First cleanup

    FileUtils.copyDirectory(testConnection.getPath(), new File(testConnection.getPath() + "_1_before_cleanup"));
    FileUtils.copyDirectory(clientA.getConfig().getDatabaseDir(), new File(clientA.getConfig().getAppDir(), "1_before_cleanup"));

    CleanupOperationOptions cleanupMergeAndRemoveOldFiles = new CleanupOperationOptions();
    cleanupMergeAndRemoveOldFiles.setMergeRemoteFiles(true);
    cleanupMergeAndRemoveOldFiles.setRemoveOldVersions(true);
    clientA.cleanup(cleanupMergeAndRemoveOldFiles);

    FileUtils.copyDirectory(testConnection.getPath(), new File(testConnection.getPath() + "_2_after_cleanup"));
    FileUtils.copyDirectory(clientA.getConfig().getDatabaseDir(), new File(clientA.getConfig().getAppDir(), "2_after_cleanup"));
View Full Code Here

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

    CleanupOperationOptions options = new CleanupOperationOptions();
    options.setMergeRemoteFiles(false);
    options.setRemoveOldVersions(true);
    options.setKeepVersionsCount(2);

    // Run

    // A: Create some file versions
    clientA.createNewFile("someotherfile.jpg"); // These two files' chunks will be in one multichunk
View Full Code Here

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

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

    CleanupOperationOptions cleanupOptions = new CleanupOperationOptions();
    cleanupOptions.setStatusOptions(statusOptions);
    cleanupOptions.setMergeRemoteFiles(false);
    cleanupOptions.setRemoveOldVersions(true);
    cleanupOptions.setKeepVersionsCount(2);

    // Run

    // A: Create some file versions
    clientA.createNewFile("file.jpg");
View Full Code Here

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

    CleanupOperationOptions options = new CleanupOperationOptions();
    options.setMergeRemoteFiles(false);
    options.setRemoveOldVersions(true);
    options.setKeepVersionsCount(2);

    // Run

    // A: Create some file versions
    clientA.createNewFile("file.jpg");
View Full Code Here

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

    CleanupOperationOptions options = new CleanupOperationOptions();
    options.setMergeRemoteFiles(false);
    options.setRemoveOldVersions(true);
    options.setKeepVersionsCount(10); // <<<<<< Different!

    // Run

    // A: Create some file versions
    clientA.createNewFile("file.jpg");
View Full Code Here

    TestClient clientA = new TestClient("A", testConnection);
    java.sql.Connection databaseConnectionA = clientA.getConfig().createDatabaseConnection();
   
    TestClient clientB = new TestClient("B", testConnection);
   
    CleanupOperationOptions cleanupOptions = new CleanupOperationOptions();
    cleanupOptions.setMinSecondsBetweenCleanups(0);

    // Scenario, see
    // https://github.com/syncany/syncany/issues/143#issuecomment-50964685
   
    // Run
View Full Code Here

TOP

Related Classes of org.syncany.operations.cleanup.CleanupOperationOptions

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.