Package org.springframework.social.dropbox.connect

Source Code of org.springframework.social.dropbox.connect.DropboxServiceProvider

package org.springframework.social.dropbox.connect;

import org.springframework.social.dropbox.api.Dropbox;
import org.springframework.social.dropbox.api.impl.DropboxTemplate;
import org.springframework.social.oauth1.AbstractOAuth1ServiceProvider;
import org.springframework.social.oauth1.OAuth1Template;
import org.springframework.social.oauth1.OAuth1Version;

/**
* @author Bryce Fischer
* @author Robert Drysdale
*/
public class DropboxServiceProvider extends AbstractOAuth1ServiceProvider<Dropbox> {
  private final boolean appFolder;
 
    public DropboxServiceProvider(String consumerKey, String consumerSecret, boolean appFolder) {
        super(consumerKey,  consumerSecret, new OAuth1Template(consumerKey, consumerSecret,
                "https://api.dropbox.com/1/oauth/request_token",
                "https://www.dropbox.com/1/oauth/authorize",
                "https://api.dropbox.com/1/oauth/access_token",
                OAuth1Version.CORE_10));
        this.appFolder = appFolder;
    }

    @Override
    public Dropbox getApi(String accessToken, String secret) {
        return new DropboxTemplate(getConsumerKey(), getConsumerSecret(), accessToken, secret, appFolder);
    }
}
TOP

Related Classes of org.springframework.social.dropbox.connect.DropboxServiceProvider

TOP
Copyright © 2018 www.massapi.com. 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.