summaryrefslogtreecommitdiffstats
path: root/POLICY-SDK-APP/src/main/java/org/onap/policy/admin/PolicyManagerServlet.java
diff options
context:
space:
mode:
Diffstat (limited to 'POLICY-SDK-APP/src/main/java/org/onap/policy/admin/PolicyManagerServlet.java')
-rw-r--r--POLICY-SDK-APP/src/main/java/org/onap/policy/admin/PolicyManagerServlet.java15
1 files changed, 7 insertions, 8 deletions
diff --git a/POLICY-SDK-APP/src/main/java/org/onap/policy/admin/PolicyManagerServlet.java b/POLICY-SDK-APP/src/main/java/org/onap/policy/admin/PolicyManagerServlet.java
index 4d549fea2..b28850dd7 100644
--- a/POLICY-SDK-APP/src/main/java/org/onap/policy/admin/PolicyManagerServlet.java
+++ b/POLICY-SDK-APP/src/main/java/org/onap/policy/admin/PolicyManagerServlet.java
@@ -530,16 +530,15 @@ public class PolicyManagerServlet extends HttpServlet {
}
try (BufferedWriter bw = new BufferedWriter(new FileWriter(temp))) {
bw.write(entity.getPolicyData());
- object = HumanPolicyComponent.DescribePolicy(temp);
} catch (IOException e) {
LOGGER.error("Exception Occured while Describing the Policy"+e);
- }finally{
- if(temp != null){
- try {
- Files.delete(temp.toPath());
- } catch (IOException e) {
- LOGGER.warn("Failed to delete " + temp.getName() + e);
- }
+ }
+ object = HumanPolicyComponent.DescribePolicy(temp);
+ if(temp != null){
+ try {
+ Files.delete(temp.toPath());
+ } catch (IOException e) {
+ LOGGER.warn("Failed to delete " + temp.getName() + e);
}
}
return object;