private GenlinkOperationResult generateLink(ConfigTO configTO) throws Exception { return new GenlinkOperation(options.getConfigTO(), options.getGenlinkOptions()).execute(); }
private void initRemoteRepository(File configFile) throws Exception { try { // Create 'syncany' and 'master' file, and all the remote folders transferManager.init(options.isCreateTarget()); // Some plugins change the transfer settings, re-save options.getConfigTO().save(configFile); } catch (StorageException e) { // Storing remotely failed. Remove all the directories and files we just created cleanLocalRepository(e); } }
logger.log(Level.INFO, "--------------------------------------------"); transferManager = createTransferManagerFromNullConfig(options.getConfigTO()); GenlinkOperationResult genlinkOperationResult = generateLink(options.getConfigTO());
private void saveLocalConfig(File configFile, File repoFile, File masterFile, String masterKeyPassword) throws Exception { if (options.isEncryptionEnabled()) { SaltedSecretKey masterKey = createMasterKeyFromPassword(masterKeyPassword); // This takes looong! options.getConfigTO().setMasterKey(masterKey); new MasterTO(masterKey.getSalt()).save(masterFile); options.getRepoTO().save(repoFile, options.getCipherSpecs(), masterKey); } else { options.getRepoTO().save(repoFile); } options.getConfigTO().save(configFile); }
public static InitOperationOptions createTestUnreliableInitOperationOptions(String machineName, List<String> failingOperationPatterns) throws Exception { InitOperationOptions initOperationOptions = createTestInitOperationOptions(machineName); // createTestInitOperationOptions always returns LocalTransferSettings File tempRpoDir = ((LocalTransferSettings) initOperationOptions.getConfigTO().getTransferSettings()).getPath(); UnreliableLocalTransferSettings transferSettings = Plugins.get("unreliable_local", TransferPlugin.class).createEmptySettings(); transferSettings.setPath(tempRpoDir); transferSettings.setFailingOperationPatterns(failingOperationPatterns); initOperationOptions.getConfigTO().setTransferSettings(transferSettings); return initOperationOptions; }
@Override public int execute(String[] operationArgs) throws Exception { boolean retryNeeded = true; boolean performOperation = true; operationOptions = parseOptions(operationArgs); while (retryNeeded && performOperation) { InitOperationResult operationResult = new InitOperation(operationOptions, this).execute(); printResults(operationResult); retryNeeded = operationResult.getResultCode() != InitResultCode.OK; if (retryNeeded) { performOperation = isInteractive && askRetryConnection(); if (performOperation) { updateTransferSettings(operationOptions.getConfigTO().getTransferSettings()); } } } return 0; }