Subversion Repositories XServices

Rev

Rev 187 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 187 Rev 197
Line 1... Line 1...
1
/**
1
/**
2
 * 
2
 * 
3
 */
3
 */
4
package net.brutex.xservices.util;
4
package net.brutex.xservices.util;
Line -... Line 5...
-
 
5
 
-
 
6
import java.io.BufferedInputStream;
-
 
7
import java.io.BufferedReader;
-
 
8
import java.io.IOException;
5
 
9
import java.io.InputStreamReader;
Line 6... Line 10...
6
import java.net.URL;
10
import java.net.URL;
7
 
11
 
8
import org.apache.commons.configuration.ConfigurationException;
12
import org.apache.commons.configuration2.ex.ConfigurationException;
9
import org.apache.commons.configuration.PropertiesConfiguration;
13
import org.apache.commons.configuration2.PropertiesConfiguration;
10
import org.apache.commons.jcs.JCS;
14
import org.apache.commons.jcs.JCS;
11
import org.apache.commons.jcs.access.exception.CacheException;
15
import org.apache.commons.jcs.access.exception.CacheException;
Line 27... Line 31...
27
			final String config = "../openair.properties";
31
			final String config = "../openair.properties";
28
			logger.info("Loading Open Air connection details from {}", config.toString());
32
			logger.info("Loading Open Air connection details from {}", config.toString());
29
			final URL configloc = OpenAirConnection.class.getClassLoader().getResource(config);
33
			final URL configloc = OpenAirConnection.class.getClassLoader().getResource(config);
30
			logger.debug("Loading Open Air connection details from {}", configloc.toString());			
34
			logger.debug("Loading Open Air connection details from {}", configloc.toString());			
Line 31... Line 35...
31
 
35
 
-
 
36
			props = new PropertiesConfiguration();
-
 
37
			props.read( new InputStreamReader( new BufferedInputStream(configloc.openStream())) );
32
			props = new PropertiesConfiguration(configloc);
38
 
33
			final String user = props.getString("user");
39
			final String user = props.getString("user");
34
			final String password = props.getString("password");
40
			final String password = props.getString("password");
35
			final String company = props.getString("company");
41
			final String company = props.getString("company");
36
			final String apikey = props.getString("apikey", "_PUT_HERE_");
42
			final String apikey = props.getString("apikey", "_PUT_HERE_");
Line 44... Line 50...
44
			logger.error(e.getMessage(), e);
50
			logger.error(e.getMessage(), e);
45
			e.printStackTrace();
51
			e.printStackTrace();
46
		} catch (ConfigurationException e) {
52
		} catch (ConfigurationException e) {
47
			logger.error(e.getMessage(), e);
53
			logger.error(e.getMessage(), e);
48
			e.printStackTrace();
54
			e.printStackTrace();
-
 
55
		} catch (IOException e) {
-
 
56
			e.printStackTrace();
49
		} finally {
57
		} finally {
Line 50... Line 58...
50
 
58
 
51
		}
59
		}
52
		return null;
60
		return null;