当前位置: 首页>>代码示例>>Java>>正文


Java DbxAppInfo类代码示例

本文整理汇总了Java中com.dropbox.core.DbxAppInfo的典型用法代码示例。如果您正苦于以下问题:Java DbxAppInfo类的具体用法?Java DbxAppInfo怎么用?Java DbxAppInfo使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


DbxAppInfo类属于com.dropbox.core包,在下文中一共展示了DbxAppInfo类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: get_authorization

import com.dropbox.core.DbxAppInfo; //导入依赖的package包/类
public static DbxAuthFinish get_authorization(JDialog parent, DbxAppInfo appInfo, DbxRequestConfig config) throws DbxException {
 DbxWebAuthNoRedirect webAuth = new DbxWebAuthNoRedirect(config, appInfo);
	
 // Have the user sign in and authorize your app.
 String authorizeUrl = webAuth.start();

 String auth_prompt = get_auth_prompt(authorizeUrl);
 JTextArea text = new JTextArea(auth_prompt);
 text.setLineWrap(true);
 text.setWrapStyleWord(true);
 JScrollPane scrollpane = new JScrollPane(text);
 scrollpane.setPreferredSize(new Dimension(200, 200));
 String code = JOptionPane.showInputDialog(scrollpane);

 // This will fail if the user enters an invalid authorization code.
 return webAuth.finish(code);

}
 
开发者ID:kd0kfo,项目名称:dropboxconnector,代码行数:19,代码来源:Connector.java

示例2: getOauthURL

import com.dropbox.core.DbxAppInfo; //导入依赖的package包/类
@Override
public String getOauthURL() {
    DbxAppInfo appInfo = new DbxAppInfo(APP_KEY, APP_SECRET);

    webAuth = new DbxWebAuthNoRedirect(config, appInfo);

    return webAuth.start();
}
 
开发者ID:modcs,项目名称:caboclo,代码行数:9,代码来源:DropboxClient.java

示例3: dbxWebAuth

import com.dropbox.core.DbxAppInfo; //导入依赖的package包/类
@Bean
public DbxWebAuth dbxWebAuth(final DbxRequestConfig requestConfig) {
    final DbxAppInfo appInfo = new DbxAppInfo(dropboxConfigProperties.getKey(), dropboxConfigProperties.getSecret());
    return new DbxWebAuth(requestConfig, appInfo);
}
 
开发者ID:zeldan,项目名称:dropbox-webhooks-spring-boot-example,代码行数:6,代码来源:DropboxConfig.java

示例4: doAuthorize

import com.dropbox.core.DbxAppInfo; //导入依赖的package包/类
private void doAuthorize() {
    DbxAppInfo appInfo = new DbxAppInfo(this.apiKey, this.apiKeySecret);
    DbxWebAuthNoRedirect webAuth = new DbxWebAuthNoRedirect(requestConfig, appInfo);

    String authorizationCode = "";
    System.out.println("1. Go to " + webAuth.start());
    System.out.println("2. Click \"Allow\" (you might have to log in first).");
    System.out.println("3. Copy the authorization code.");
    System.out.print("Enter the authorization code: ");
    BufferedReader consoleIn = null;
    try {
        consoleIn = new BufferedReader(new InputStreamReader(System.in));
        authorizationCode = consoleIn.readLine();
    } catch (IOException ioe) {
        ioe.printStackTrace(System.err);
    }
    if (authorizationCode == null || authorizationCode.length() == 0) {
        System.err.println("Invalid authorization code!");
        System.err.println("Exiting now...");
        System.exit(1);
    }

    DbxAuthFinish authFinish = null;
    try {
        authFinish = webAuth.finish(authorizationCode);
    } catch (DbxException ex) {
        System.err.println("Error in DbxWebAuth.start: " + ex.getMessage());
        System.err.println("Exiting now...");
        System.exit(1);
    }
    if (authFinish == null) {
        System.err.println("Something went wrong doing the authorization!");
        System.err.println("Exiting now...");
        System.exit(1);
    }

    System.out.println("Authorization completed successfully!");
    System.out.println("- User ID: " + authFinish.userId);
    System.out.println("- Access Token: " + authFinish.accessToken);

    accessToken = authFinish.accessToken;

    // Write this already out
    writeOut();
}
 
开发者ID:TomVSt,项目名称:JavaPiSync,代码行数:46,代码来源:JavaPiSync.java

示例5: Main

import com.dropbox.core.DbxAppInfo; //导入依赖的package包/类
private Main(PrintWriter log, DbxAppInfo dbxAppInfo, File userDbFile) throws IOException, Common.DatabaseException {
    this.common = new Common(log, dbxAppInfo, userDbFile);
    this.dropboxAuth = new DropboxAuth(common);
    this.dropboxBrowse = new DropboxBrowse(common);
}
 
开发者ID:dropbox,项目名称:dropbox-sdk-java,代码行数:6,代码来源:Main.java

示例6: Common

import com.dropbox.core.DbxAppInfo; //导入依赖的package包/类
public Common(PrintWriter log, DbxAppInfo dbxAppInfo, File userDbFile) throws IOException, DatabaseException {
    this.log = log;
    this.dbxAppInfo = dbxAppInfo;
    this.userDbFile = userDbFile;
    this.userDb = loadUserDb(userDbFile);
}
 
开发者ID:dropbox,项目名称:dropbox-sdk-java,代码行数:7,代码来源:Common.java

示例7: initialize

import com.dropbox.core.DbxAppInfo; //导入依赖的package包/类
private void initialize(Context ctx, String _appKey, String _appSecret,
                        boolean clearKeysOnStart, AccessType accessType) {
    appInfo = new DbxAppInfo(_appKey,_appSecret);
    mContext = ctx;

    if (clearKeysOnStart)
        clearKeys();

    this.mAccessType = accessType;

    buildSession();

}
 
开发者ID:PhilippC,项目名称:keepass2android,代码行数:14,代码来源:DropboxV2Storage.java

示例8: connect

import com.dropbox.core.DbxAppInfo; //导入依赖的package包/类
public static DbxClient connect(APIKeyStore apikey, JDialog parent) throws IOException, DbxException {

	BuildInfo info = new BuildInfo(Connector.class);
	
	DbxAppInfo appInfo = new DbxAppInfo(apikey.APP_KEY, apikey.APP_SECRET);
	
	DbxRequestConfig config = new DbxRequestConfig("DropboxConnector/" + info.get_version(),
						       Locale.getDefault().toString());
	return new DbxClient(config, get_authorization(parent, appInfo, config).accessToken);
    }
 
开发者ID:kd0kfo,项目名称:dropboxconnector,代码行数:11,代码来源:Connector.java


注:本文中的com.dropbox.core.DbxAppInfo类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。