From fd1106bedbe8c4a8d7b83ece28a94c4d458bdf68 Mon Sep 17 00:00:00 2001 From: Luke Markie Date: Mon, 11 Mar 2024 16:09:40 +0000 Subject: [PATCH] Fix CFPlugin for CF 2023 Windows service --- .../java/com/intergral/deep/plugin/cf/Utils.java | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/plugins/cf-plugin/src/main/java/com/intergral/deep/plugin/cf/Utils.java b/plugins/cf-plugin/src/main/java/com/intergral/deep/plugin/cf/Utils.java index aa8e426..5a2ce84 100644 --- a/plugins/cf-plugin/src/main/java/com/intergral/deep/plugin/cf/Utils.java +++ b/plugins/cf-plugin/src/main/java/com/intergral/deep/plugin/cf/Utils.java @@ -28,12 +28,22 @@ private Utils() { /** * Are we running on a CF server. *

- * By looking at the java start up command we can tell if this is a CF server. + * By checking that the coldfusion.home system property exists, or by looking at the java start up command, + * we can tell if this is a CF server. * * @return {@code true} if we are on a coldfusion server. */ public static boolean isCFServer() { - return System.getProperty("sun.java.command").contains("coldfusion"); + if (System.getProperty("coldfusion.home") != null) { + return true; + } + + final String javaCommand = System.getProperty("sun.java.command"); + // has the potential to not exist on Windows services + if (javaCommand == null) { + return false; + } + return javaCommand.contains("coldfusion"); } /**