Search code examples
javaapipropertiestwitter4j

twitter4j configuration


I'm trying to configure twitter4j to stream tweets

  1. I got (consumer key/secret, access token & access secret) from twitter already
  2. I created a new java project and imported twiiter4j as a library

Now I want to know how to configure it ( http://twitter4j.org/en/configuration.html)

The first way :
Save a standard properties file named "twitter4j.properties". Place it to either the current directory, root of the classpath directory.

I'm using netbeans and want to know the file type I should choose when I create properties file and where exactly I have to place it?


Solution

  • Answer to your questions:

    1. Select a normal text file type, add the contents and rename it to twitter4j.properties
    2. You may place the file in the root folder of your project, or in any folder in the classpath. Just be sure the folder is in the classpath, thats what needs to be taken care of.