Package org.syncany.config

Examples of org.syncany.config.Config


  private void startWatchOperations(Map<File, FolderTO> newWatchedFolderTOs) throws ConfigException, ServiceAlreadyStartedException {
    for (Map.Entry<File, FolderTO> folderEntry : newWatchedFolderTOs.entrySet()) {
      File localDir = folderEntry.getKey();

      try
        Config watchConfig = ConfigHelper.loadConfig(localDir);
       
        if (watchConfig != null) {
          logger.log(Level.INFO, "- Starting watch operation at " + localDir + " ...");         
         
          WatchOperationOptions watchOptions = folderEntry.getValue().getWatchOptions();
View Full Code Here


public class StatusOperationTest {

  @Test
  public void testStatusOperation() throws Exception {
    // Setup
    Config config = TestConfigUtil.createTestLocalConfig();
   
    // Add new files
    List<File> originalFiles = TestFileUtil.createRandomFilesInDirectory(config.getLocalDir(), 500*1024, 3);
    
    // Status
    ChangeSet changeSet = (new StatusOperation(config).execute()).getChangeSet();       
   
    assertEquals(changeSet.getNewFiles().size(), originalFiles.size());
View Full Code Here

  }
 
  @Test
  public void testVeryRecentFileModificationWithoutSizeOrModifiedDateChange() throws Exception {
    // Setup
    Config config = TestConfigUtil.createTestLocalConfig();   
    File testFile = TestFileUtil.createRandomFileInDirectory(config.getLocalDir(), 40);
   
    StatusOperationOptions statusOptions = new StatusOperationOptions();
    statusOptions.setForceChecksum(true);

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

  }
 
  @Test
  public void testNotSoRecentFileModificationWithoutSizeOrModifiedDateChange() throws Exception {
    // Setup
    Config config = TestConfigUtil.createTestLocalConfig();
    File testFile = TestFileUtil.createRandomFileInDirectory(config.getLocalDir(), 40);
   
    // Perform 'up', wait a second and then change test file
    // IMPORTANT: Sleep to prevent detailed checksum-based update check in 'status' operation
    new UpOperation(config).execute();       
    Thread.sleep(2000);
View Full Code Here

  }
 
  @Test
  public void testCreateFolderAndRunStatus() throws Exception {
    // Setup
    Config config = TestConfigUtil.createTestLocalConfig();
    new File(config.getLocalDir()+"/somefolder").mkdir();
       
    // Run 'status', this SHOULD list the folder
    ChangeSet changeSet = (new StatusOperation(config).execute()).getChangeSet();           
    assertEquals(changeSet.getNewFiles().size(), 1);
    assertEquals(changeSet.getChangedFiles().size(), 0);
View Full Code Here

    clientB.up(upOptionsForceEnabled);
   
    clientB.down(); // This creates a dirty database       
   
    // Test (for dirty database existence)
    Config configB = clientB.getConfig();
    java.sql.Connection databaseConnectionB = configB.createDatabaseConnection();

    ChunkSqlDao chunkDao = new ChunkSqlDao(databaseConnectionB);
    MultiChunkSqlDao multiChunkDao = new MultiChunkSqlDao(databaseConnectionB);
    FileVersionSqlDao fileVersionDao = new FileVersionSqlDao(databaseConnectionB);
    FileHistorySqlDao fileHistoryDao = new FileHistorySqlDao(databaseConnectionB, fileVersionDao);
View Full Code Here

import org.syncany.operations.watch.WatchOperationOptions;
import org.syncany.plugins.transfer.TransferSettings;

public class TestClient extends Client {
  public TestClient(String machineName, TransferSettings connection) throws Exception {
    Config testConfig = TestConfigUtil.createTestLocalConfig(machineName, connection);
    testConfig.setMachineName(machineName);
    testConfig.setDisplayName(machineName);
   
    this.setConfig(testConfig);
 
View Full Code Here

    if (!decryptFile.exists()) {
      throw new Exception("Given file does not exist: "+decryptFile);     
    }
   
    Config config = client.getConfig();
    InputStream fileInputStream = config.getTransformer().createInputStream(new FileInputStream(decryptFile));
   
    IOUtils.copy(fileInputStream, System.out);   
    System.exit(0);
  }
View Full Code Here

TOP

Related Classes of org.syncany.config.Config

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.