t = new Thread(new Dequeuer());
}
public void connectAndRead() throws Exception {
ConfigurationBuilder cb = new ConfigurationBuilder();
Properties twitterProperties = new Properties();
File twitter4jPropsFile = new File(System.getProperty("user.home") + "/twitter4j.properties");
if (!twitter4jPropsFile.exists()) {
logger.error(
"Cannot find twitter4j.properties file in this location :[{}]. Make sure it is available at this place and includes user/password credentials",
twitter4jPropsFile.getAbsolutePath());
return;
}
twitterProperties.load(new FileInputStream(twitter4jPropsFile));
cb.setDebugEnabled(Boolean.valueOf(twitterProperties.getProperty("debug")))
.setUser(twitterProperties.getProperty("user")).setPassword(twitterProperties.getProperty("password"));
TwitterStream twitterStream = new TwitterStreamFactory(cb.build()).getInstance();
StatusListener statusListener = new StatusListener() {
@Override
public void onException(Exception ex) {
logger.error("error", ex);