Package org.syncany.plugins.transfer

Examples of org.syncany.plugins.transfer.StorageTestResult


    return result;
  }

  private boolean performRepoTest() {
    boolean testCreateTarget = options.isCreateTarget();
    StorageTestResult testResult = transferManager.test(testCreateTarget);

    logger.log(Level.INFO, "Storage test result ist " + testResult);

    if (testResult.isTargetExists() && testResult.isTargetCanWrite() && !testResult.isRepoFileExists()) {
      logger.log(Level.INFO, "--> OKAY: Target exists and is writable, but repo doesn't exist. We're good to go!");
      return true;
    }
    else if (testCreateTarget && !testResult.isTargetExists() && testResult.isTargetCanCreate()) {
      logger.log(Level.INFO, "--> OKAY: Target does not exist, but can be created. We're good to go!");
      return true;
    }
    else {
      logger.log(Level.INFO, "--> NOT OKAY: Invalid target/repo state. Operation cannot be continued.");
View Full Code Here


    return configTO;
  }

  private boolean performRepoTest(TransferManager transferManager) {
    StorageTestResult testResult = transferManager.test(false);

    logger.log(Level.INFO, "Storage test result ist " + testResult);

    if (testResult.isRepoFileExists()) {
      logger.log(Level.INFO, "--> OKAY: Repo file exists. We're good to go!");
      return true;
    }
    else {
      logger.log(Level.INFO, "--> NOT OKAY: Invalid target/repo state. Operation cannot be continued.");
View Full Code Here

        out.println("To automatically sync this folder, simply restart the daemon with 'sy daemon restart'.");
        out.println();
      }
    }
    else if (concreteOperationResult.getResultCode() == InitResultCode.NOK_TEST_FAILED) {
      StorageTestResult testResult = concreteOperationResult.getTestResult();
      out.println();

      if (testResult.isRepoFileExists()) {
        out.println("ERROR: Repository cannot be initialized, because it already exists ('syncany' file");
        out.println("       exists). Are you sure that you want to create a new repo?  Use 'sy connect'");
        out.println("       to connect to an existing repository.");
      }
      else if (!testResult.isTargetCanConnect()) {
        out.println("ERROR: Repository cannot be initialized, because the connection to the storage backend failed.");
        out.println("       Possible reasons for this could be connectivity issues (are you connect to the Internet?),");
        out.println("       or invalid user credentials (are username/password valid?).");
      }
      else if (!testResult.isTargetExists()) {
        if (!operationOptions.isCreateTarget()) {
          out.println("ERROR: Repository cannot be initialized, because the target does not exist and");
          out.println("       the --create-target/-t option has not been enabled. Either create the target");
          out.println("       manually or retry with the --create-target/-t option.");
        }
        else {
          out.println("ERROR: Repository cannot be initialized, because the target does not exist and");
          out.println("       it cannot be created. Please check your permissions or create the target manually.");
        }
      }
      else if (!testResult.isTargetCanWrite()) {
        out.println("ERROR: Repository cannot be initialized, because the target is not writable. This is probably");
        out.println("       a permission issue (does the user have write permissions to the target?).");
      }
      else {
        out.println("ERROR: Repository cannot be initialized.");
View Full Code Here

        out.println("To automatically sync this folder, simply restart the daemon with 'sy daemon restart'.");
        out.println();
      }
    }
    else if (concreteOperationResult.getResultCode() == ConnectResultCode.NOK_TEST_FAILED) {
      StorageTestResult testResult = concreteOperationResult.getTestResult();
      out.println();

      if (!testResult.isTargetCanConnect()) {
        out.println("ERROR: Cannot connect to the repository, because the connection to the storage backend failed.");
        out.println("       Possible reasons for this could be connectivity issues (are you connect to the Internet?),");
        out.println("       or invalid user credentials (are username/password valid?).");
      }
      else if (!testResult.isTargetExists()) {
        out.println("ERROR: Cannot connect to the repository, because the target does not exist.");
        out.println("       Please check if it really exists and if you can read from it / write to it.");
      }
      else if (!testResult.isTargetCanWrite()) {
        out.println("ERROR: Cannot connect to the repository, because the target is not writable. This is probably");
        out.println("       a permission issue (does the user have write permissions to the target?).");
      }
      else if (!testResult.isRepoFileExists()) {
        out.println("ERROR: Cannot connect to the repository, because no repo file was found ('syncany' file).");
        out.println("       Are you sure that this is a valid Syncany repository? Use 'sy init' to create a new one.");
      }
      else {
        out.println("ERROR: Cannot connect to the repository.");
View Full Code Here

TOP

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

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.