this.commonClassDao = commonClassDao;
}
- @Override
+ @Override
public Map<String, String> savePolicies() throws PAPException {
Map<String, String> successMap = new HashMap<>();
// Saving the json Configurations file if exists at server location for action policy.
private void saveActionBody(String policyName, String actionBodyData) {
- 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);
+ try(BufferedWriter bw = new BufferedWriter(new FileWriter(file.getAbsoluteFile()))) {
bw.write(actionBodyData);
- bw.close();
if (LOGGER.isInfoEnabled()) {
LOGGER.info("Action Body is succesfully saved at " + file.getAbsolutePath());
}
}
public String getFunctionDefinitionId(String key){
- FunctionDefinition object = (FunctionDefinition) commonClassDao.getDataById(FunctionDefinition.class, "short_name", key);
- if(object != null){
- return object.getXacmlid();
- }
- return null;
+ FunctionDefinition object = (FunctionDefinition) commonClassDao.getDataById(FunctionDefinition.class, "short_name", key);
+ if(object != null){
+ return object.getXacmlid();
+ }
+ return null;
}
}
\ No newline at end of file