+ System.setProperty(AntConstants.WORK_DIR_PROPERTY, workDir
+ .getCanonicalPath());
+
+ // Additional properties in slc.properties file. Already set sytem
+ // properties (such as the various directories) can be resolved in
+ // placeholders.
+ if (confDir != null) {
+ Resource slcPropertiesRes = confDir
+ .createRelative("slc.properties");
+ if (slcPropertiesRes.exists()) {
+ Properties slcProperties = new Properties();
+ InputStream in = slcPropertiesRes.getInputStream();
+ try {
+ slcProperties.load(in);
+ } finally {
+ IOUtils.closeQuietly(in);
+ }
+
+ for (Object obj : slcProperties.keySet()) {
+ String key = obj.toString();
+ if (!System.getProperties().containsKey(key)) {
+ String value = SystemPropertyUtils
+ .resolvePlaceholders(slcProperties
+ .getProperty(key));
+ System.setProperty(key, value);
+ }
+ }
+ }
+ }
+ } catch (Exception e) {
+ throw new SlcException("Cannot init system properties.", e);
+ }
+ }
+
+ /**
+ * Set property as an absolute file path if the resource can be located on
+ * the file system, or as an url.
+ */
+ private void setSystemPropertyForRes(String key, Resource res)
+ throws IOException {
+ String value = null;
+ try {
+ value = res.getFile().getCanonicalPath();
+ } catch (IOException e) {
+ value = res.getURL().toString();
+ }
+ System.setProperty(key, value);
+ }
+
+ protected ConfigurableApplicationContext createExecutionContext(
+ SlcExecution slcExecution) {
+ try {