Package com.dropbox.core

Examples of com.dropbox.core.DbxClient


     * @throws DropboxException
     */
    public void createClient() throws DropboxException {
        DbxRequestConfig config =
                new DbxRequestConfig(clientIdentifier, Locale.getDefault().toString());
        DbxClient client = new DbxClient(config, accessToken);
        if (client == null) {
            throw new DropboxException("can't establish a Dropbox conenction!");
        }
        this.client = client;

View Full Code Here


        FileUtils.write(this.tokenPath.toFile(), token);

        LOGGER.log(Level.INFO, "client token stored in '" + this.tokenPath + "'");
      }

      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

        UPLOAD_JOB_KEY.compareTo(context.getJobDetail().getKey()) == 0;
     
      DropboxSynchronizer synchronizer = DropboxSynchronizer.instance;
      if (synchronizer != null) {
        try {
          DbxClient client = getClient(synchronizer);
          if (client != null) {
            if (isUpload) {
              synchronizer.syncLocalToDropbox(client);
            } else {
              synchronizer.syncDropboxToLocal(client);
View Full Code Here

     * @return a new {@link DbxClient} or <code>null</code> if no access token has been found.
     */
    private DbxClient getClient(DropboxSynchronizer synchronizer) {
      String accessToken = synchronizer.readAccessToken();
       if (StringUtils.isNotBlank(accessToken)) {
         return new DbxClient(requestConfig, accessToken);
       }
      return null;
    }
View Full Code Here

TOP

Related Classes of com.dropbox.core.DbxClient

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.