X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=ONAP-PAP-REST%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fpolicy%2Fpap%2Fxacml%2Frest%2FPAPRestConfig.java;h=7e514ef245f1b9f052b4188ba1636f526cdd3d8b;hb=a97e1eafd731937aab373213ab04c3296cc97595;hp=1b9afe5477ac5bba0e5c8210e1a241129438a69d;hpb=0b437d897ed2f18df6d89987056faa945531c033;p=policy%2Fengine.git diff --git a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/PAPRestConfig.java b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/PAPRestConfig.java index 1b9afe547..7e514ef24 100644 --- a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/PAPRestConfig.java +++ b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/PAPRestConfig.java @@ -57,9 +57,8 @@ public class PAPRestConfig extends WebMvcConfigurerAdapter { @PostConstruct public void init(){ Properties prop = new Properties(); - InputStream input = null; - try { - input = new FileInputStream("xacml.pap.properties"); + + try(InputStream input = new FileInputStream("xacml.pap.properties")) { // load a properties file prop.load(input); setDbDriver(prop.getProperty("javax.persistence.jdbc.driver")); @@ -68,14 +67,6 @@ public class PAPRestConfig extends WebMvcConfigurerAdapter { setDbPassword( CryptoUtils.decryptTxtNoExStr(prop.getProperty("javax.persistence.jdbc.password", ""))); }catch(Exception e){ LOGGER.error("Exception Occured while loading properties file"+e); - }finally{ - if(input != null){ - try { - input.close(); - } catch (IOException e) { - LOGGER.error("Exception Occured while clsoing the stream"+e); - } - } } }