- 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);
+ if (policyName.endsWith(".xml")) {
+ policyName = policyName.replace(".xml", "");
+ }
+ File file = new File(ACTION_HOME + File.separator + policyName + ".json");
+ try (BufferedWriter bw = new BufferedWriter(new FileWriter(file.getAbsoluteFile()))) {