aboutsummaryrefslogtreecommitdiff
path: root/id/server/stork2-saml-engine/src/main/java
diff options
context:
space:
mode:
authorFlorian Reimair <florian.reimair@iaik.tugraz.at>2014-01-29 15:13:42 +0100
committerFlorian Reimair <florian.reimair@iaik.tugraz.at>2014-01-31 17:16:10 +0100
commit85a983b556baaaa45ea79a4da232a1a72d323708 (patch)
treed7980a109ccb618b258214e8ebf7ae48e4d1c177 /id/server/stork2-saml-engine/src/main/java
parent830929713b75d4cd712f1fb8a05f0ccb728f54f2 (diff)
downloadmoa-id-spss-85a983b556baaaa45ea79a4da232a1a72d323708.tar.gz
moa-id-spss-85a983b556baaaa45ea79a4da232a1a72d323708.tar.bz2
moa-id-spss-85a983b556baaaa45ea79a4da232a1a72d323708.zip
enhanced samlengine for floating config location
Diffstat (limited to 'id/server/stork2-saml-engine/src/main/java')
-rw-r--r--id/server/stork2-saml-engine/src/main/java/eu/stork/peps/configuration/ConfigurationReader.java18
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);