2014-02-07 38 views
1

即使我已将其复制到Eclipse中项目文件夹的根目录,我仍无法让我的项目读取我的twitter4j.properties文件。Twitter4j.properties文件未被读取

oauth.consumerKey=thisismyconsumerkey 
oauth.consumerSecret=thisismyconsumersecret 
oath.accessToken=14778563-thisismyaccesstoken 
oath.accessTokenSecret=thisismyaccesstokensecret 
debug=true 
http.prettyDebug=true 

我发起的Twitter信息中,像这样:

TwitterStream twitterStream = new TwitterStreamFactory().getInstance(); 
twitterStream.addListener(listener); 

twitterStream.sample(); 

我能够得到应用,如果我手动运行我已经按照配置向导,像这样填写的属性文件使用ConfigurationBuilder进行设置,但我希望应用程序改为读取我的属性文件。为了让我的项目能够识别文件,还有其他事情需要我做吗?

回答

1

完全忽略了我的accessToken和accessTokenSecret。 oath应该是oauth。让这是一个教训:不要在深夜编写代码。

为了什么是值得的,我把twitter4j.properties文件放在我的项目文件夹的根目录下,它的工作原理非常完美。