diff options
author | Thomas Lenz <tlenz@iaik.tugraz.at> | 2015-07-03 13:21:37 +0200 |
---|---|---|
committer | Thomas Lenz <tlenz@iaik.tugraz.at> | 2015-07-03 13:21:37 +0200 |
commit | ff9703e221414e9840638911b53f441eb86afb72 (patch) | |
tree | 2c23cadded9bc055b5aac3e0a35d886864ca71d0 /id | |
parent | 91dfafd601d12d91347b1c09efb47d8f14da8760 (diff) | |
download | moa-id-spss-ff9703e221414e9840638911b53f441eb86afb72.tar.gz moa-id-spss-ff9703e221414e9840638911b53f441eb86afb72.tar.bz2 moa-id-spss-ff9703e221414e9840638911b53f441eb86afb72.zip |
fix problems with absolut configuration paths
Diffstat (limited to 'id')
-rw-r--r-- | id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/PropertyBasedAuthConfigurationProvider.java | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/PropertyBasedAuthConfigurationProvider.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/PropertyBasedAuthConfigurationProvider.java index 08a8dcdf2..9535c9aa3 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/PropertyBasedAuthConfigurationProvider.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/PropertyBasedAuthConfigurationProvider.java @@ -5,6 +5,8 @@ import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; import java.math.BigInteger; +import java.net.MalformedURLException; +import java.net.URI; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; @@ -63,7 +65,14 @@ public class PropertyBasedAuthConfigurationProvider extends ConfigurationProvide public PropertyBasedAuthConfigurationProvider(String fileName) throws ConfigurationException { File propertiesFile = new File(fileName); rootConfigFileDir = propertiesFile.getParent(); - + try { + rootConfigFileDir = new File(rootConfigFileDir).toURI().toURL().toString(); + + } catch (MalformedURLException t) { + throw new ConfigurationException("config.03", null, t); + + } + System.getProperties().setProperty("location", "file:" + fileName); context = new ClassPathXmlApplicationContext( new String[] { "moaid.configuration.beans.xml", @@ -946,7 +955,7 @@ public class PropertyBasedAuthConfigurationProvider extends ConfigurationProvide @Override public String getCertstoreDirectory() { try { - String path = configuration.getStringValue( + String path = rootConfigFileDir + configuration.getStringValue( MOAIDConfigurationConstants.GENERAL_AUTH_CERTSTORE_URL); if (MiscUtil.isNotEmpty(path)) return path; @@ -966,7 +975,7 @@ public class PropertyBasedAuthConfigurationProvider extends ConfigurationProvide @Override public String getTrustedCACertificates() { try { - String path = configuration.getStringValue( + String path = rootConfigFileDir + configuration.getStringValue( MOAIDConfigurationConstants.GENERAL_AUTH_TRUSTSTORE_URL); if (MiscUtil.isNotEmpty(path)) return path; |