Package org.syncany.config.to

Examples of org.syncany.config.to.UserConfigTO


    }
  }

  private static void loadAndInitUserConfigFile(File userConfigFile) {
    try {
      UserConfigTO userConfigTO = UserConfigTO.load(userConfigFile);

      // System properties
      for (Map.Entry<String, String> systemProperty : userConfigTO.getSystemProperties().entrySet()) {
        System.setProperty(systemProperty.getKey(), systemProperty.getValue());
      }

      // Other options
      preventStandby = userConfigTO.preventStandbyEnabled();
      configEncryptionKey = userConfigTO.getConfigEncryptionKey();
    }
    catch (ConfigException e) {
      System.err.println("ERROR: " + e.getMessage());
      System.err.println("       Ignoring user config file!");
      System.err.println();
View Full Code Here


      System.err.println();
    }
  }

  private static void writeExampleUserConfigFile(File userConfigFile) {
    UserConfigTO userConfigTO = new UserConfigTO();

    userConfigTO.getSystemProperties().put("example.property", "This is a demo property. You can delete it.");
    userConfigTO.getSystemProperties().put("syncany.rocks", "Yes, it does!");

    try {
      System.out.println("First launch, creating a secret key (could take a sec)...");
      SaltedSecretKey configEncryptionKey = CipherUtil.createMasterKey(CipherUtil.createRandomAlphabeticString(USER_CONFIG_ENCRYPTION_KEY_LENGTH));

      userConfigTO.setConfigEncryptionKey(configEncryptionKey);
      userConfigTO.save(userConfigFile);
    }
    catch (Exception e) {
      // Don't care!
    }
  }
View Full Code Here

TOP

Related Classes of org.syncany.config.to.UserConfigTO

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.