diff options
author | Maurice Laveaux <m.laveaux@student.tue.nl> | 2014-05-01 17:09:31 +0200 |
---|---|---|
committer | Maurice Laveaux <m.laveaux@student.tue.nl> | 2014-05-01 17:09:31 +0200 |
commit | 355bb332328a16ae967cf276bfdbe4cda0776c47 (patch) | |
tree | d6ba7b3cdcda3ae8da8ce6eff167f5c1395fcf58 /src/utils/Configuration.java | |
parent | 24fc22336273e919517cde2e8a81b5e4222f9e91 (diff) | |
download | TwitterDataAnalytics-355bb332328a16ae967cf276bfdbe4cda0776c47.tar.gz |
Added the target command with options: file, shell.
* Implemented target file, which uses DataWriter as
RequestListener which writes the tweets and profiles.
* Added profiles-filename, tweets-filename to the config.
Diffstat (limited to 'src/utils/Configuration.java')
-rw-r--r-- | src/utils/Configuration.java | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/utils/Configuration.java b/src/utils/Configuration.java index abb4df0..78bd9e2 100644 --- a/src/utils/Configuration.java +++ b/src/utils/Configuration.java @@ -22,6 +22,9 @@ public class Configuration { public static final String REQUEST_TOKEN_URL = "https://twitter.com/oauth/request_token"; public static final String AUTHORIZE_URL = "https://twitter.com/oauth/authorize"; public static final String ACCESS_TOKEN_URL = "https://twitter.com/oauth/access_token"; + + public static final String DEFAULT_TWEETS_FILENAME = "tweets.txt"; + public static final String DEFAULT_PROFILE_FILENAME = "profiles.txt"; private final Properties properties; private final File storeFile; @@ -77,6 +80,17 @@ public class Configuration { * @return The value for the key or null if there is none. */ public String getProperty(String key) { - return properties.getProperty(key); + return getProperty(key, null); + } + + /** + * Gets a setting with the given key. + * + * @param key Name of the configuration setting. + * @param defaultVal The default value for the key. + * @return The value for the key or null if there is none. + */ + public String getProperty(String key, String defaultVal) { + return properties.getProperty(key, defaultVal); } } |