X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=datarouter-subscriber%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fdmaap%2Fdatarouter%2Fsubscriber%2FSubscriberProps.java;h=c060a9b00b3a99b045f7cb33250b2952a9d4cb95;hb=bda6aeaa60607ab4fe5af508156019d7bd5c0ce4;hp=39ab166b9fdc0ba3a5fbf6c9a56766381bd52a0d;hpb=dffdd1d82c6aa0adfb7a24703af48870f182ccfa;p=dmaap%2Fdatarouter.git diff --git a/datarouter-subscriber/src/main/java/org/onap/dmaap/datarouter/subscriber/SubscriberProps.java b/datarouter-subscriber/src/main/java/org/onap/dmaap/datarouter/subscriber/SubscriberProps.java index 39ab166b..c060a9b0 100644 --- a/datarouter-subscriber/src/main/java/org/onap/dmaap/datarouter/subscriber/SubscriberProps.java +++ b/datarouter-subscriber/src/main/java/org/onap/dmaap/datarouter/subscriber/SubscriberProps.java @@ -25,24 +25,34 @@ package org.onap.dmaap.datarouter.subscriber; import java.io.IOException; import java.util.Properties; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + public class SubscriberProps { + private static final Logger logger = LoggerFactory.getLogger(SubscriberProps.class); + private static SubscriberProps instance = null; - private Properties properties; + private final Properties properties; - private SubscriberProps(String propsPath) throws IOException{ + private SubscriberProps(String propsPath) throws IOException { properties = new Properties(); properties.load(getClass().getClassLoader().getResourceAsStream(propsPath)); } + /** + * Get instance of subscriber properties. + * @param propsPath path to properties file + * @return SubscriberProps object + */ public static SubscriberProps getInstance(String propsPath) { - if(instance == null) { + if (instance == null) { try { instance = new SubscriberProps(propsPath); } catch (IOException ioe) { - ioe.printStackTrace(); + logger.error("IO Exception: " + ioe.getMessage(), ioe); } } return instance;