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%2Fcontroller%2FPushPolicyController.java;h=397904f30defde9f04350970b83c5714b9fbbff2;hb=eef3c224cb6cad4b82a96938ade1e42ca881eea2;hp=107983562da46c13ec640f71a56460ce2cd18b53;hpb=44fd25bcbb86f8600ec88eeeac6bb8312672c470;p=policy%2Fengine.git diff --git a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/controller/PushPolicyController.java b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/controller/PushPolicyController.java index 107983562..397904f30 100644 --- a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/controller/PushPolicyController.java +++ b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/controller/PushPolicyController.java @@ -161,10 +161,8 @@ public class PushPolicyController { return; } File temp = new File(policyName); - try { - BufferedWriter bw = new BufferedWriter(new FileWriter(temp)); + try (BufferedWriter bw = new BufferedWriter(new FileWriter(temp))){ bw.write(policyEntity.getPolicyData()); - bw.close(); URI selectedURI = temp.toURI(); // Create the policy Object selectedPolicy = new StdPDPPolicy(policyName, true, policyID, selectedURI);