tfg.twitterservice.TwitterContextBuilder.java Source code

Java tutorial

Introduction

Here is the source code for tfg.twitterservice.TwitterContextBuilder.java

Source

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package tfg.twitterservice;

import modelo.UserTwitterTokens;
import twitter4j.conf.ConfigurationBuilder;

/**
 *
 * @author estevo
 */

public class TwitterContextBuilder implements TwitterApplicationTokens {
    ConfigurationBuilder confBuilder;

    public TwitterContextBuilder(UserTwitterTokens userTwitterTokens) {
        this.confBuilder = new ConfigurationBuilder();
        this.confBuilder.setOAuthConsumerKey(consumerKey);
        this.confBuilder.setOAuthConsumerSecret(consumerSecret);
        this.confBuilder.setOAuthAccessToken(userTwitterTokens.getAccessToken());
        this.confBuilder.setOAuthAccessTokenSecret(userTwitterTokens.getAccessTokenSecret());

    }

    public ConfigurationBuilder getConfBuilder() {
        return confBuilder;
    }

}