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:55 UTC
[karaf] branch karaf-4.1.x 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 karaf-4.1.x
in repository https://gitbox.apache.org/repos/asf/karaf.git
The following commit(s) were added to refs/heads/karaf-4.1.x by this push:
new 48802f7 [KARAF-5646] Support env:XXX substitution for system.properties
48802f7 is described below
commit 48802f750ae28fe2ab55d74b282cb51d3ffaebe5
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 ccd6af1..ed1b8bc 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
@@ -26,6 +26,8 @@ import java.io.InputStream;
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;
@@ -109,16 +111,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.