You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@karaf.apache.org by gn...@apache.org on 2018/03/15 11:57:35 UTC
[karaf] branch master updated: [KARAF-5646] Support env:XXX
substitution for system.properties
This is an automated email from the ASF dual-hosted git repository.
gnodet pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/karaf.git
The following commit(s) were added to refs/heads/master by this push:
new d4fe806 [KARAF-5646] Support env:XXX substitution for system.properties
d4fe806 is described below
commit d4fe806bf3c33163c4e8e17cbd8b2c2aa81cd47a
Author: Guillaume Nodet <gn...@gmail.com>
AuthorDate: Thu Mar 15 12:57:24 2018 +0100
[KARAF-5646] Support env:XXX substitution for system.properties
---
.../main/java/org/apache/karaf/util/config/PropertiesLoader.java | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/util/src/main/java/org/apache/karaf/util/config/PropertiesLoader.java b/util/src/main/java/org/apache/karaf/util/config/PropertiesLoader.java
index d4d7758..dcb22dc 100644
--- a/util/src/main/java/org/apache/karaf/util/config/PropertiesLoader.java
+++ b/util/src/main/java/org/apache/karaf/util/config/PropertiesLoader.java
@@ -24,6 +24,8 @@ import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.Enumeration;
+
+import org.apache.felix.utils.properties.InterpolationHelper;
import org.apache.felix.utils.properties.Properties;
import java.util.StringTokenizer;
@@ -108,16 +110,17 @@ public class PropertiesLoader {
// Ignore
return;
}
-
+
+ InterpolationHelper.SubstitutionCallback callback = new InterpolationHelper.BundleContextSubstitutionCallback(null);
for (Enumeration<?> e = props.propertyNames(); e.hasMoreElements();) {
String name = (String) e.nextElement();
if (name.startsWith(OVERRIDE_PREFIX)) {
String overrideName = name.substring(OVERRIDE_PREFIX.length());
String value = props.getProperty(name);
- System.setProperty(overrideName, substVars(value, name, null, props));
+ System.setProperty(overrideName, substVars(value, name, null, props, callback));
} else {
String value = System.getProperty(name, props.getProperty(name));
- System.setProperty(name, substVars(value, name, null, props));
+ System.setProperty(name, substVars(value, name, null, props, callback));
}
}
}
--
To stop receiving notification emails like this one, please contact
gnodet@apache.org.