-
- File file = new File(ACTION_HOME + File.separator + path + "." + removeVersion + "." + version + ".json");
-
- if (logger.isDebugEnabled())
- logger.debug("The action body is at " + file.getAbsolutePath());
-
- // if file doesn't exists, then create it
- if (!file.exists()) {
- file.createNewFile();
- }
- File configHomeDir = new File(ACTION_HOME);
- File[] listOfFiles = configHomeDir.listFiles();
- if (listOfFiles != null){
- for(File eachFile : listOfFiles){
- if(eachFile.isFile()){
- String fileNameWithoutExtension = FilenameUtils.removeExtension(eachFile.getName());
- String actionFileNameWithoutExtension = FilenameUtils.removeExtension(path + "." + policyName);
- if (fileNameWithoutExtension.equals(actionFileNameWithoutExtension)){
- //delete the file
- if (logger.isInfoEnabled())
- logger.info("Deleting action body is at " + eachFile.getAbsolutePath());
- eachFile.delete();
- }
- }
- }
+ if(policyName.endsWith(".xml")){
+ policyName = policyName.replace(".xml", "");