View Javadoc

1   /*
2      Licensed under the Apache License, Version 2.0 (the "License");
3      you may not use this file except in compliance with the License.
4      You may obtain a copy of the License at
5   
6        http://www.apache.org/licenses/LICENSE-2.0
7   
8      Unless required by applicable law or agreed to in writing, software
9      distributed under the License is distributed on an "AS IS" BASIS,
10     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11     See the License for the specific language governing permissions and
12     limitations under the License.
13  */
14  package uk.nhs.interoperability.util;
15  
16  import java.io.IOException;
17  import java.util.Properties;
18  
19  /**
20   * The Class ITKServiceProperties.
21   *
22   * @author Michael Odling-Smee
23   * @author Nicholas Jones
24   * @since 0.1
25   */
26  public class ITKServiceProperties {
27      
28  	// TODO - consider if these properties should be in the config properties file?
29  	
30  	/** The props. */
31  	private static Properties props = new Properties();
32  	static {
33  		try {
34  			props.load(ITKServiceProperties.class.getResourceAsStream("/service.properties"));
35  			
36  		} catch (IOException ex){
37  			ex.printStackTrace();
38  		}
39  	}
40  	
41  	/**
42  	 * Gets the property.
43  	 *
44  	 * @param propertyName the property name
45  	 * @return the property
46  	 */
47  	public static String getProperty(String propertyName){
48  		return props.getProperty(propertyName);
49  	}
50  
51  }