Subversion Repositories XServices

Rev

Rev 188 | Rev 193 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 188 Rev 191
Line 6... Line 6...
6
 
6
 
7
import javax.ws.rs.core.GenericEntity;
7
import javax.ws.rs.core.GenericEntity;
8
import javax.ws.rs.core.HttpHeaders;
8
import javax.ws.rs.core.HttpHeaders;
Line 9... Line 9...
9
import javax.ws.rs.core.Response;
9
import javax.ws.rs.core.Response;
10
 
10
 
-
 
11
import org.apache.commons.configuration2.PropertiesConfiguration;
11
import org.apache.commons.configuration.ConfigurationException;
12
import org.apache.commons.configuration2.builder.fluent.Configurations;
12
import org.apache.commons.configuration.PropertiesConfiguration;
13
import org.apache.commons.configuration2.ex.ConfigurationException;
13
import org.apache.commons.jcs.JCS;
14
import org.apache.commons.jcs.JCS;
14
import org.apache.commons.jcs.access.exception.CacheException;
15
import org.apache.commons.jcs.access.exception.CacheException;
Line 52... Line 53...
52
	private OpenAirRestConnection getOpenAirConnection() {
53
	private OpenAirRestConnection getOpenAirConnection() {
Line 53... Line 54...
53
 
54
 
54
		/*
55
		/*
55
		 * get details from configuration file
56
		 * get details from configuration file
-
 
57
		 */
56
		 */
58
		Configurations configs = new Configurations();
57
		final PropertiesConfiguration props;
59
		final PropertiesConfiguration props;
58
		try {
60
		try {
59
			final String config = "../openair.properties";
61
			final String config = "../openair.properties";
60
			logger.debug("Loading Open Air connection details from " + this.getClass().getClassLoader().getResource("/")
62
			logger.debug("Loading Open Air connection details from " + this.getClass().getClassLoader().getResource("/")
Line 61... Line 63...
61
					+ config);
63
					+ config);
Line 62... Line 64...
62
 
64
 
-
 
65
			final URL configloc = this.getClass().getClassLoader().getResource(config);
63
			final URL configloc = this.getClass().getClassLoader().getResource(config);
66
 
64
 
67
			props = configs.properties(configloc);
65
			props = new PropertiesConfiguration(configloc);
68
			
66
			final String user = props.getString("user");
69
			final String user = props.getString("user");
67
			final String password = props.getString("password");
70
			final String password = props.getString("password");
Line 68... Line 71...
68
			final String company = props.getString("company");
71
			final String company = props.getString("company");
Line 69... Line 72...
69
			final String apikey = props.getString("apikey", "9x7G49ENkLCJ81i9XZJU");
72
			final String apikey = props.getString("apikey", "_PUT_HERE_");