diff options
Diffstat (limited to 'ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/controller/PushPolicyController.java')
-rw-r--r-- | ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/controller/PushPolicyController.java | 4 |
1 files changed, 1 insertions, 3 deletions
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); |