aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/net/java/sip/communicator/plugin/provisioning/ProvisioningServiceImpl.java45
1 files changed, 45 insertions, 0 deletions
diff --git a/src/net/java/sip/communicator/plugin/provisioning/ProvisioningServiceImpl.java b/src/net/java/sip/communicator/plugin/provisioning/ProvisioningServiceImpl.java
index a351985..a3c26ab 100644
--- a/src/net/java/sip/communicator/plugin/provisioning/ProvisioningServiceImpl.java
+++ b/src/net/java/sip/communicator/plugin/provisioning/ProvisioningServiceImpl.java
@@ -5,6 +5,7 @@ import java.io.*;
import java.net.*;
import java.util.*;
import java.util.List;
+import java.util.regex.*;
import javax.swing.*;
@@ -268,6 +269,50 @@ public class ProvisioningServiceImpl
ProvisioningActivator.getNetworkAddressManagerService().
getLocalHost(InetAddress.getByName(u.getHost()));
+ // Get any system environment identified by ${env.xyz}
+ Pattern p = Pattern.compile("\\$\\{env\\.([^\\}]*)\\}");
+ Matcher m = p.matcher(url);
+ StringBuffer sb = new StringBuffer();
+ while(m.find())
+ {
+ String value = System.getenv(m.group(1));
+ if(value != null)
+ {
+ m.appendReplacement(sb, Matcher.quoteReplacement(value));
+ }
+ }
+ m.appendTail(sb);
+ url = sb.toString();
+
+ // Get any system property variable identified by ${system.xyz}
+ p = Pattern.compile("\\$\\{system\\.([^\\}]*)\\}");
+ m = p.matcher(url);
+ sb = new StringBuffer();
+ while(m.find())
+ {
+ String value = System.getProperty(m.group(1));
+ if(value != null)
+ {
+ m.appendReplacement(sb, Matcher.quoteReplacement(value));
+ }
+ }
+ m.appendTail(sb);
+ url = sb.toString();
+
+ if(url.indexOf("${home.location}") != -1)
+ {
+ url = url.replace("${home.location}",
+ ProvisioningActivator.getConfigurationService()
+ .getScHomeDirLocation());
+ }
+
+ if(url.indexOf("${home.name}") != -1)
+ {
+ url = url.replace("${home.name}",
+ ProvisioningActivator.getConfigurationService()
+ .getScHomeDirName());
+ }
+
if(url.indexOf("${uuid}") != -1)
{
url = url.replace("${uuid}",