From 2794acf3d9824b28336445026e4a3b437b779f75 Mon Sep 17 00:00:00 2001 From: antelder Date: Fri, 6 Feb 2009 11:37:55 +0000 Subject: Update config files for logging properties files based on the install location git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@741543 13f79535-47bb-0310-9956-ffa450edef68 --- .../java/org/apache/tuscany/sca/launcher/LauncherMain.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'java/sca/modules/launcher') diff --git a/java/sca/modules/launcher/src/main/java/org/apache/tuscany/sca/launcher/LauncherMain.java b/java/sca/modules/launcher/src/main/java/org/apache/tuscany/sca/launcher/LauncherMain.java index 04f2d0b906..35e6060d0f 100644 --- a/java/sca/modules/launcher/src/main/java/org/apache/tuscany/sca/launcher/LauncherMain.java +++ b/java/sca/modules/launcher/src/main/java/org/apache/tuscany/sca/launcher/LauncherMain.java @@ -55,15 +55,22 @@ public class LauncherMain { invokeMainMethod(mainClassName, classLoader, mainArgs); } - private static void setSystemProperties(Properties launcherProperties) { + private static void setSystemProperties(Properties launcherProperties) throws URISyntaxException { for (Enumeration e = launcherProperties.propertyNames(); e.hasMoreElements();) { String pn = (String) e.nextElement(); if (pn.startsWith("-D")) { - System.setProperty(pn.substring(2), launcherProperties.getProperty(pn)); + System.setProperty(pn.substring(2), keywordExpand(launcherProperties.getProperty(pn))); } } } + private static String keywordExpand(String property) throws URISyntaxException { + if (property.contains("{TUSCANY_HOME}")) { + property = property.replace("{TUSCANY_HOME}", getLauncherFolder().getParentFile().getAbsolutePath()); + } + return property; + } + private static String[] getMainArgs(Properties launcherProperties) { String[] mainArgs = (String[])launcherProperties.get(LAUNCHER_ARGS); if (mainArgs == null) { -- cgit v1.2.3