Example usage for twitter4j.auth NullAuthorization getInstance

List of usage examples for twitter4j.auth NullAuthorization getInstance

Introduction

In this page you can find the example usage for twitter4j.auth NullAuthorization getInstance.

Prototype

public static NullAuthorization getInstance() 

Source Link

Usage

From source file:mx.bigdata.t4j.TwitterStreamImpl.java

License:Apache License

private void init() {
    if (null == auth) {
        // try to populate OAuthAuthorization if available in the configuration
        String consumerKey = conf.getOAuthConsumerKey();
        String consumerSecret = conf.getOAuthConsumerSecret();
        // try to find oauth tokens in the configuration
        if (null != consumerKey && null != consumerSecret) {
            OAuthAuthorization oauth = new OAuthAuthorization(conf);
            String accessToken = conf.getOAuthAccessToken();
            String accessTokenSecret = conf.getOAuthAccessTokenSecret();
            if (null != accessToken && null != accessTokenSecret) {
                oauth.setOAuthAccessToken(new AccessToken(accessToken, accessTokenSecret));
            }/*  w  w w  .j  a v a 2s.  com*/
            this.auth = oauth;
        } else {
            this.auth = NullAuthorization.getInstance();
        }
    }
}