@@ -0,0 +1,1269 @@
+package gov.nih.nci.cadsr.sentinel.util;%0A%0Aimport java.io.IOException;%0Aimport java.io.InputStream;%0Aimport java.io.Serializable;%0Aimport java.util.Properties;%0A%0A/**%0A * class to read a properties file%0A * %0A * @author myu%0A */%0Apublic class SentinelToolProperties implements Serializable %7B%0A%0A%09InputStream is = null;%0A%09private Properties props = null;%0A%09private static SentinelToolProperties SentinelToolProperties = null;%0A%0A%09private SentinelToolProperties() throws IOException %7B%0A%09%09props = loadProps();%0A%09%7D%0A%0A%09public static SentinelToolProperties getFactory() %7B%0A%09%09try %7B%0A%09%09%09if (SentinelToolProperties == null) %7B%0A%09%09%09%09SentinelToolProperties = new SentinelToolProperties();%0A%09%09%09%7D%0A%0A%09%09%7D catch (IOException e) %7B%0A%09%09%09// TODO Auto-generated catch block%0A%09%09%09e.printStackTrace();%0A%0A%09%09%7D%0A%09%09return SentinelToolProperties;%0A%09%7D%0A%0A%09private Properties loadProps() throws IOException %7B%0A%09%09try %7B%0A%09%09%09ClassLoader cl = this.getClass().getClassLoader();%0A%09%09%09is = cl.getResourceAsStream(%22project.properties%22);%0A%09%09%09props = new Properties();%0A%09%09%09props.load(is);%0A%09%09%7D catch (Exception e) %7B%0A%09%09%09throw new IOException(%22Unable to get properties in loadProps() : %22%0A%09%09%09%09%09+ e);%0A%09%09%7D finally %7B%0A%09%09%09if (is != null)%0A%09%09%09%09is.close();%0A%09%09%7D%0A%0A%09%09return props;%0A%09%7D%0A%0A%09public String getProperty(String key) %7B%0A%09%09return props.getProperty(key);%0A%09%7D%0A%7D%0A

Fix Help URL