summaryrefslogtreecommitdiffstats
path: root/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/PAPRestConfig.java
diff options
context:
space:
mode:
Diffstat (limited to 'ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/PAPRestConfig.java')
-rw-r--r--ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/PAPRestConfig.java13
1 files changed, 2 insertions, 11 deletions
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);
- }
- }
}
}