From 403be1bc7349fce300957b5946675e0b48e7f55f Mon Sep 17 00:00:00 2001 From: Robert von Burg Date: Thu, 9 Feb 2023 14:18:03 +0100 Subject: [PATCH] [New] Added new constants ENV_STROLCH_ENV, ENV_STROLCH_PATH --- .../java/li/strolch/agent/api/StrolchBootstrapper.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/agent/src/main/java/li/strolch/agent/api/StrolchBootstrapper.java b/agent/src/main/java/li/strolch/agent/api/StrolchBootstrapper.java index b9c363ab6..bd1d4515a 100644 --- a/agent/src/main/java/li/strolch/agent/api/StrolchBootstrapper.java +++ b/agent/src/main/java/li/strolch/agent/api/StrolchBootstrapper.java @@ -41,6 +41,8 @@ public class StrolchBootstrapper extends DefaultHandler { private static final String TEMP = "temp"; public static final String FILE_BOOTSTRAP = "StrolchBootstrap.xml"; + public static final String ENV_STROLCH_ENV = "STROLCH_ENV"; + public static final String ENV_STROLCH_PATH = "STROLCH_PATH"; public static final String PATH_CONFIG = "config"; //$NON-NLS-1$ public static final String PATH_DATA = "data"; //$NON-NLS-1$ @@ -334,8 +336,8 @@ public class StrolchBootstrapper extends DefaultHandler { if (!this.envFound) { throw new StrolchConfigurationException( - "Environment " + this.environment + " not configured in bootstrap configuration " + bootstrapFile - .getAbsolutePath()); + "Environment " + this.environment + " not configured in bootstrap configuration " + + bootstrapFile.getAbsolutePath()); } evaluatePaths(); @@ -358,8 +360,8 @@ public class StrolchBootstrapper extends DefaultHandler { // validate the parsed data if (!this.defaultAllowed) { - if (StringHelper.isEmpty(this.configS) || StringHelper.isEmpty(this.dataS) || StringHelper - .isEmpty(this.tempS)) { + if (StringHelper.isEmpty(this.configS) || StringHelper.isEmpty(this.dataS) || StringHelper.isEmpty( + this.tempS)) { String msg = "One element of " + Arrays.toString(new String[] { CONFIG, DATA, TEMP }) + " is not set and environment " + this.environment + " does not have attribute " + DEFAULT + "=\"true\". Either set the value or allow using default values!";