diff options
Diffstat (limited to 'id/server/stork2-saml-engine/src/main/java/eu/stork')
-rw-r--r-- | id/server/stork2-saml-engine/src/main/java/eu/stork/peps/configuration/ConfigurationReader.java | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/configuration/ConfigurationReader.java b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/configuration/ConfigurationReader.java index 9ae8bb669..e9b067e76 100644 --- a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/configuration/ConfigurationReader.java +++ b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/configuration/ConfigurationReader.java @@ -15,6 +15,7 @@ package eu.stork.peps.configuration;
+import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.HashMap;
@@ -119,8 +120,14 @@ public final class ConfigurationReader { */
public static Map<String, InstanceEngine> readConfiguration()
throws SAMLEngineException {
-
- LOGGER.info("Init reader: " + ENGINE_CONF_FILE);
+
+ // fetch base from system properties, give a default if there is nothing configured
+ String base = System.getProperty("eu.stork.samlengine.config.location");
+ if(null != base)
+ if(!base.endsWith("/"))
+ base += "/";
+
+ LOGGER.info("Init reader: " + base + ENGINE_CONF_FILE);
final Map<String, InstanceEngine> instanceConfs =
new HashMap<String, InstanceEngine>();
@@ -137,9 +144,10 @@ public final class ConfigurationReader { builder = factory.newDocumentBuilder();
- engineConf = ConfigurationReader.class
- .getResourceAsStream("/" + ENGINE_CONF_FILE);
-
+ if(null != base)
+ engineConf = new FileInputStream(base + ENGINE_CONF_FILE);
+ else
+ engineConf = ConfigurationReader.class.getResourceAsStream("/" + ENGINE_CONF_FILE);
document = builder.parse(engineConf);
|