Skip to content

Commit

Permalink
Delete config file if applicationMonitor property not set
Browse files Browse the repository at this point in the history
  • Loading branch information
evie-lau committed Aug 7, 2023
1 parent cc715a7 commit 6b004a0
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,12 @@ public ApplicationMonitorConfigXmlDocument(String tool) {
}

public void writeAppMonitorConfigXmlDocument(File serverDirectory, String applicationMonitorValue) throws IOException, TransformerException, ParserConfigurationException, PluginExecutionException {
File appMonXml = getAppMonitorConfigXmlFile(serverDirectory);
// if applicationMonitor not set, return
if (applicationMonitorValue == null) {
if (appMonXml.exists()) {
appMonXml.delete();
}
return;
}
// continue with creating configDropins/override file
Expand All @@ -49,7 +53,6 @@ public void writeAppMonitorConfigXmlDocument(File serverDirectory, String applic
}
attributes.put("updateTrigger", applicationMonitorValue);

File appMonXml = getAppMonitorConfigXmlFile(serverDirectory);
if (!appMonXml.getParentFile().exists()) {
appMonXml.getParentFile().mkdirs();
}
Expand Down

0 comments on commit 6b004a0

Please sign in to comment.