本文整理汇总了Java中twitter4j.conf.Configuration.getOAuthAccessToken方法的典型用法代码示例。如果您正苦于以下问题:Java Configuration.getOAuthAccessToken方法的具体用法?Java Configuration.getOAuthAccessToken怎么用?Java Configuration.getOAuthAccessToken使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类twitter4j.conf.Configuration
的用法示例。
在下文中一共展示了Configuration.getOAuthAccessToken方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: OAuthAuthorization
import twitter4j.conf.Configuration; //导入方法依赖的package包/类
/**
* @param conf configuration
*/
public OAuthAuthorization(Configuration conf) {
this.conf = conf;
http = new HttpClientWrapper(conf);
setOAuthConsumer(conf.getOAuthConsumerKey(), conf.getOAuthConsumerSecret());
if (conf.getOAuthAccessToken() != null && conf.getOAuthAccessTokenSecret() != null) {
setOAuthAccessToken(new AccessToken(conf.getOAuthAccessToken(), conf.getOAuthAccessTokenSecret()));
}
}
示例2: getInstance
import twitter4j.conf.Configuration; //导入方法依赖的package包/类
/**
* @param conf configuration
* @return authorization instance
* @since Twitter4J 2.1.11
*/
public static Authorization getInstance(Configuration conf) {
Authorization auth = null;
String consumerKey = conf.getOAuthConsumerKey();
String consumerSecret = conf.getOAuthConsumerSecret();
if (consumerKey != null && consumerSecret != null) {
OAuthAuthorization oauth;
oauth = new OAuthAuthorization(conf);
String accessToken = conf.getOAuthAccessToken();
String accessTokenSecret = conf.getOAuthAccessTokenSecret();
if (accessToken != null && accessTokenSecret != null) {
oauth.setOAuthAccessToken(new AccessToken(accessToken, accessTokenSecret));
}
auth = oauth;
} else {
String screenName = conf.getUser();
String password = conf.getPassword();
if (screenName != null && password != null) {
auth = new BasicAuthorization(screenName, password);
}
}
if (null == auth) {
auth = NullAuthorization.getInstance();
}
return auth;
}
示例3: OAuthAuthorization
import twitter4j.conf.Configuration; //导入方法依赖的package包/类
/**
* @param conf configuration
*/
public OAuthAuthorization(Configuration conf) {
this.conf = conf;
http = HttpClientFactory.getInstance(conf.getHttpClientConfiguration());
setOAuthConsumer(conf.getOAuthConsumerKey(), conf.getOAuthConsumerSecret());
if (conf.getOAuthAccessToken() != null && conf.getOAuthAccessTokenSecret() != null) {
setOAuthAccessToken(new AccessToken(conf.getOAuthAccessToken(), conf.getOAuthAccessTokenSecret()));
}
}