* Creates a fully populated {@link BeesClientConfiguration} based on the current setting.
*/
public BeesClientConfiguration createConfigurations() throws IOException {
Properties properties = getConfigProperties();
BeesClientConfiguration beesClientConfiguration = new BeesClientConfiguration(getApiUrl());
String token = properties.getProperty("bees.api.oauth_token");
if (token!=null) {
// use OAuth token for authentication
beesClientConfiguration.withOAuthToken(token);
} else {
// fallback to API key and secret
if (key==null) key = properties.getProperty("bees.api.key");
if (secret==null) secret = properties.getProperty("bees.api.secret");
initCredentials();
beesClientConfiguration.withApiKeyAndSecret(key,secret);
}
// Set proxy information
beesClientConfiguration.setProxyHost(properties.getProperty("bees.api.proxy.host", proxyHost));
if (properties.getProperty("bees.api.proxy.port") != null || proxyPort != null)
beesClientConfiguration.setProxyPort(Integer.parseInt(properties.getProperty("bees.api.proxy.port", proxyPort)));
beesClientConfiguration.setProxyUser(properties.getProperty("bees.api.proxy.user", proxyUser));
beesClientConfiguration.setProxyPassword(properties.getProperty("bees.api.proxy.password", proxyPassword));
return beesClientConfiguration;
}