Fix new version of commons-configurations usage

git-svn-id: https://brutex.net/svn/xservices/trunk@191 e7e49efb-446e-492e-b9ec-fcafc1997a86
master
Brian Rosenberger 2018-08-22 08:52:06 +00:00
parent 9a0d90a4b4
commit d24bd44218
1 changed files with 7 additions and 4 deletions

View File

@ -8,8 +8,9 @@ import javax.ws.rs.core.GenericEntity;
import javax.ws.rs.core.HttpHeaders;
import javax.ws.rs.core.Response;
import org.apache.commons.configuration.ConfigurationException;
import org.apache.commons.configuration.PropertiesConfiguration;
import org.apache.commons.configuration2.PropertiesConfiguration;
import org.apache.commons.configuration2.builder.fluent.Configurations;
import org.apache.commons.configuration2.ex.ConfigurationException;
import org.apache.commons.jcs.JCS;
import org.apache.commons.jcs.access.exception.CacheException;
import org.apache.logging.log4j.LogManager;
@ -54,6 +55,7 @@ public class OpenAirInfoServiceImpl implements OpenAirInfoService {
/*
* get details from configuration file
*/
Configurations configs = new Configurations();
final PropertiesConfiguration props;
try {
final String config = "../openair.properties";
@ -62,11 +64,12 @@ public class OpenAirInfoServiceImpl implements OpenAirInfoService {
final URL configloc = this.getClass().getClassLoader().getResource(config);
props = new PropertiesConfiguration(configloc);
props = configs.properties(configloc);
final String user = props.getString("user");
final String password = props.getString("password");
final String company = props.getString("company");
final String apikey = props.getString("apikey", "9x7G49ENkLCJ81i9XZJU");
final String apikey = props.getString("apikey", "_PUT_HERE_");
final String namespace = props.getString("namespace");
final OpenAirRestConnection con;