Package cloudsync.exceptions

Examples of cloudsync.exceptions.CloudsyncException


      if (!Files.exists(lockFilePath, LinkOption.NOFOLLOW_LINKS)) {

        Files.createFile(lockFilePath);
      }
    } catch (IOException e) {
      throw new CloudsyncException("Couldn't create '" + lockFilePath.toString() + "'");
    }

    isLocked = true;
  }
View Full Code Here


      return;

    try {
      Files.delete(lockFilePath);
    } catch (IOException e) {
      throw new CloudsyncException("Couldn't remove '" + lockFilePath.toString() + "'");
    }

    try {

      if (root.getChildren().size() > 0) {

        LOGGER.log(Level.INFO, "write structure to cache file");
        final PrintWriter out = new PrintWriter(cacheFilePath.toFile());
        final CSVPrinter csvOut = new CSVPrinter(out, CSVFormat.EXCEL);
        writeStructureToCSVPrinter(csvOut, root);
        out.close();
      }
    } catch (final IOException e) {
      throw new CloudsyncException("Can't write cache file on '" + cacheFilePath.toString() + "'", e);
    }

    isLocked = false;
  }
View Full Code Here

        item.setParent(parent);
        parent.addChild(item);
      }
    } catch (final IOException e) {

      throw new CloudsyncException("Can't read cache from file '" + cacheFilePath.toString() + "'", e);
    }
  }
View Full Code Here

      for (final Item item : list) {
        message += "  " + item.getRemoteIdentifier() + " - " + item.getPath() + "\n";
      }
      message += "\n  try to run with '--clean=<path>'";

      throw new CloudsyncException(message);
    }
  }
View Full Code Here

      }

      client = new DbxClient(config, token);

    } catch (DbxException e) {
      throw new CloudsyncException("Can't init remote dropbox connector", e);
    } catch (IOException e) {
      throw new CloudsyncException("Can't init remote dropbox connector", e);
    }
  }
View Full Code Here

          client.delete(entry.path);
        }
      }
    } catch (final DbxException e) {

      throw new CloudsyncException("Unexpected error during history cleanup", e);
    }
  }
View Full Code Here

      LOGGER.log(Level.WARNING, getExceptionMessage(e) + name + " - retry " + count + "/" + RETRY_COUNT);

      return count;
    }

    throw new CloudsyncException("Unexpected error during " + name + (item == null ? "" : " of " + item.getTypeName() + " '" + item.getPath() + "'"), e);
  }
View Full Code Here

  public RemoteDropboxOptions(CmdOptions options, String name) throws CloudsyncException {

    final String[] propertyNames = new String[] { "DROPBOX_APP_KEY", "DROPBOX_APP_SECRET", "DROPBOX_TOKEN_PATH", "DROPBOX_DIR" };
    for (final String propertyName : propertyNames) {
      if (StringUtils.isEmpty(options.getProperty(propertyName))) {
        throw new CloudsyncException("'" + propertyName + "' is not configured");
      }
    }

    appKey = options.getProperty("DROPBOX_APP_KEY");
    appSecret = options.getProperty("DROPBOX_APP_SECRET");
View Full Code Here

  public RemoteGoogleDriveOptions(CmdOptions options, String name) throws CloudsyncException {

    final String[] propertyNames = new String[] { "GOOGLE_DRIVE_CLIENT_ID", "GOOGLE_DRIVE_CLIENT_SECRET", "GOOGLE_DRIVE_CLIENT_TOKEN_PATH", "GOOGLE_DRIVE_DIR" };
    for (final String propertyName : propertyNames) {
      if (StringUtils.isEmpty(options.getProperty(propertyName))) {
        throw new CloudsyncException("'" + propertyName + "' is not configured");
      }
    }

    clientID = options.getProperty("GOOGLE_DRIVE_CLIENT_ID");
    clientSecret = options.getProperty("GOOGLE_DRIVE_CLIENT_SECRET");
View Full Code Here

TOP

Related Classes of cloudsync.exceptions.CloudsyncException

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.