Package org.syncany.plugins.transfer

Examples of org.syncany.plugins.transfer.TransferSettings


 
  @Test
  public void testRestoreDeletedFileWithTargetFile() throws Exception {
    // Setup
    File tempDir = TestFileUtil.createTempDirectoryInSystemTemp();
    TransferSettings testConnection = TestConfigUtil.createTestLocalConnection();   
    TestClient clientA = new TestClient("A", testConnection);
    java.sql.Connection databaseConnectionA = DatabaseConnectionFactory.createConnection(clientA.getDatabaseFile());
       
    // A new/up
    clientA.createNewFile("A-original");   
View Full Code Here


 
  @Test
  public void testRestoreDeletedWithSubfolders() throws Exception {
    // Setup
    File tempDir = TestFileUtil.createTempDirectoryInSystemTemp();
    TransferSettings testConnection = TestConfigUtil.createTestLocalConnection();   
    TestClient clientA = new TestClient("A", testConnection);
    java.sql.Connection databaseConnectionA = DatabaseConnectionFactory.createConnection(clientA.getDatabaseFile());
       
    // A new/up
    clientA.createNewFolder("folder/subfolder");
View Full Code Here

public class ChangedAttributesScenarioTest {
  @Test
  public void testChangeAttributes() throws Exception {   
    // Setup
    TransferSettings testConnection = TestConfigUtil.createTestLocalConnection();   
    TestClient clientA = new TestClient("A", testConnection);
    TestClient clientB = new TestClient("B", testConnection);

    // Run
    clientA.createNewFile("file1.jpg");
View Full Code Here

 
 
  @Test
  public void testNewFileWithDifferingAttributes() throws Exception {   
    // Setup
    TransferSettings testConnection = TestConfigUtil.createTestLocalConnection();   
    TestClient clientA = new TestClient("A", testConnection);
    TestClient clientB = new TestClient("B", testConnection);

    // Create new file with differing attributes
    clientA.createNewFile("file1.jpg");
View Full Code Here

    logger.log(Level.INFO, "--------------------------------------------");

    // Init plugin and transfer manager
    plugin = Plugins.get(options.getConfigTO().getTransferSettings().getType(), TransferPlugin.class);

    TransferSettings transferSettings = options.getConfigTO().getTransferSettings();
    transferSettings.setUserInteractionListener(listener);

    transferManager = plugin.createTransferManager(transferSettings, config);

    // Test the repo
    if (!performRepoTest()) {
View Full Code Here

      if (plugin == null) {
        throw new StorageException("Link contains unknown connection type '" + pluginId + "'. Corresponding plugin not found.");
      }

      Class<? extends TransferSettings> pluginTransferSettingsClass = TransferPluginUtil.getTransferSettingsClass(plugin.getClass());
      TransferSettings transferSettings = new Persister().read(pluginTransferSettingsClass, pluginSettings);

      logger.log(Level.INFO, "(Decrypted) link contains: " + pluginId + " -- " + pluginSettings);

      return transferSettings;
    }
View Full Code Here

    // Init plugin and transfer manager
    String pluginId = options.getConfigTO().getTransferSettings().getType();
    plugin = Plugins.get(pluginId, TransferPlugin.class);

    TransferSettings transferSettings = (TransferSettings) options.getConfigTO().getTransferSettings();
    transferSettings.setUserInteractionListener(listener);

    transferManager = plugin.createTransferManager(transferSettings, null); // "null" because no config exists yet!

    // Test the repo
    if (!performRepoTest(transferManager)) {
View Full Code Here

        // Non-interactive mode
        if (masterPassword != null) {
          logger.log(Level.INFO, " - Link is encrypted. Password available.");

          SaltedSecretKey masterKey = createMasterKeyFromPassword(masterPassword, applicationLink.getMasterKeySalt());
          TransferSettings transferSettings = applicationLink.createTransferSettings(masterKey);

          configTO.setMasterKey(masterKey);
          configTO.setTransferSettings(transferSettings);
        }
        else {
          logger.log(Level.INFO, " - Link is encrypted. Asking for password.");

          boolean retryPassword = true;

          while (retryPassword) {
            // Ask password
            masterPassword = getOrAskPassword();

            // Generate master key
            SaltedSecretKey masterKey = createMasterKeyFromPassword(masterPassword, applicationLink.getMasterKeySalt());

            // Decrypt config
            try {
              TransferSettings transferSettings = applicationLink.createTransferSettings(masterKey);

              configTO.setMasterKey(masterKey);
              configTO.setTransferSettings(transferSettings);

              retryPassword = false;
            }
            catch (CipherException e) {
              retryPassword = askRetryPassword();
            }
          }
        }

        if (configTO.getTransferSettings() == null) {
          throw new CipherException("Unable to decrypt link.");
        }
      }
      else {
        logger.log(Level.INFO, " - Link is NOT encrypted. No password needed.");

        TransferSettings transferSettings = applicationLink.createTransferSettings();
        configTO.setTransferSettings(transferSettings);
      }
    }
    catch (Exception e) {
      throw new StorageException("Unable to extract connection settings: " + e.getMessage(), e);
View Full Code Here

  private static final Logger logger = Logger.getLogger(CallUpWhileStillWritingFileScenarioTest.class.getSimpleName());

  @Test
  public void testUpWhileWritingFile() throws Exception {
    // Setup
    final TransferSettings testConnection = TestConfigUtil.createTestLocalConnection();

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

    final File testFile = clientA.getLocalFile("large-test-file");
View Full Code Here

public class DirtyDatabaseVersionsScenarioTest {
  @Test
  public void testThreeClientsOneLoser() throws Exception {   
    // Setup
    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();
View Full Code Here

TOP

Related Classes of org.syncany.plugins.transfer.TransferSettings

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.