summary |
shortlog |
log |
commit | commitdiff |
review |
tree
raw |
patch |
inline | side by side (from parent 1:
0e75793)
// Saving the json Configurations file if exists at server location for action policy.
private void saveActionBody(String policyName, String actionBodyData) {
// Saving the json Configurations file if exists at server location for action policy.
private void saveActionBody(String policyName, String actionBodyData) {
if(policyName.endsWith(".xml")){
policyName = policyName.replace(".xml", "");
}
File file = new File(ACTION_HOME+ File.separator + policyName + ".json");
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.write(actionBodyData);
if (LOGGER.isInfoEnabled()) {
LOGGER.info("Action Body is succesfully saved at " + file.getAbsolutePath());
}
if (LOGGER.isInfoEnabled()) {
LOGGER.info("Action Body is succesfully saved at " + file.getAbsolutePath());
}