diff options
author | Pamela Dragosh <pdragosh@research.att.com> | 2018-03-13 16:19:52 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2018-03-13 16:19:52 +0000 |
commit | 3c9de6694e0cdf7f5c8c17d3180af52ceb33903c (patch) | |
tree | 3e23275df0a70f3cf9fb056180f61cb20accbd00 /ONAP-PAP-REST/src/main/java/org/onap | |
parent | 5746f9ca2ea6a4ac3facadae169d6289867fd4a5 (diff) | |
parent | 5242bcd284b8ea10528b96bb3f70f921d998aee1 (diff) |
Merge "Policy:Blocker"
Diffstat (limited to 'ONAP-PAP-REST/src/main/java/org/onap')
-rw-r--r-- | ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/ActionPolicy.java | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/ActionPolicy.java b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/ActionPolicy.java index 91530c7af..43eb4348e 100644 --- a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/ActionPolicy.java +++ b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/ActionPolicy.java @@ -256,15 +256,12 @@ public class ActionPolicy extends Policy { // Saving the json Configurations file if exists at server location for action policy. private void saveActionBody(String policyName, String actionBodyData) { - try { if(policyName.endsWith(".xml")){ policyName = policyName.replace(".xml", ""); } File file = new File(ACTION_HOME+ File.separator + policyName + ".json"); - FileWriter fw = new FileWriter(file.getAbsoluteFile()); - BufferedWriter bw = new BufferedWriter(fw); + try(BufferedWriter bw = new BufferedWriter(new FileWriter(file.getAbsoluteFile()))) { bw.write(actionBodyData); - bw.close(); if (LOGGER.isInfoEnabled()) { LOGGER.info("Action Body is succesfully saved at " + file.getAbsolutePath()); } |