aboutsummaryrefslogtreecommitdiff
path: root/id/server/idserverlib
diff options
context:
space:
mode:
authorThomas Lenz <tlenz@iaik.tugraz.at>2013-08-08 15:51:10 +0200
committerThomas Lenz <tlenz@iaik.tugraz.at>2013-08-08 15:51:10 +0200
commit84b4c1da0e05567812ea30e899a4a28f9d421bc0 (patch)
treeef4f0b863ad4bdcd7ff2cbb2523ef75f25f80a71 /id/server/idserverlib
parent2337072ac18b66e523818702ba6dce6b462472b1 (diff)
downloadmoa-id-spss-84b4c1da0e05567812ea30e899a4a28f9d421bc0.tar.gz
moa-id-spss-84b4c1da0e05567812ea30e899a4a28f9d421bc0.tar.bz2
moa-id-spss-84b4c1da0e05567812ea30e899a4a28f9d421bc0.zip
some changes in LegacyConfigImporter
Diffstat (limited to 'id/server/idserverlib')
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/legacy/BuildFromLegacyConfig.java29
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/legacy/ConfigurationBuilder.java26
2 files changed, 32 insertions, 23 deletions
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/legacy/BuildFromLegacyConfig.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/legacy/BuildFromLegacyConfig.java
index 0c5a50393..762669a70 100644
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/legacy/BuildFromLegacyConfig.java
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/legacy/BuildFromLegacyConfig.java
@@ -82,7 +82,7 @@ public class BuildFromLegacyConfig {
private static final String GENERIC_CONFIG_PARAM_SOURCEID = "AuthenticationServer.SourceID";
- public static MOAIDConfiguration build(String fileName, String rootConfigFileDir, Properties properies) throws ConfigurationException {
+ public static MOAIDConfiguration build(File fileName, String rootConfigFileDir) throws ConfigurationException {
InputStream stream = null;
Element configElem;
ConfigurationBuilder builder;
@@ -435,20 +435,21 @@ public class BuildFromLegacyConfig {
//OA_PVP2
OAPVP2 oa_pvp2 = new OAPVP2();
oa_auth.setOAPVP2(oa_pvp2);
- oa_pvp2.setMetadataURL("TODO!!!");
- //TODO: is only a workaround!!!!
- Properties props = getGeneralPVP2ProperiesConfig(properies);
- File dir = new File(props.getProperty("idp.truststore"));
- File[] files = dir.listFiles();
- if (files.length > 0) {
- FileInputStream filestream = new FileInputStream(files[0]);
- X509Certificate signerCertificate = new X509Certificate(filestream);
- oa_pvp2.setCertificate(signerCertificate.getEncoded());
-
- } else {
- oa_pvp2.setCertificate(null);
- }
+// oa_pvp2.setMetadataURL("empty");
+//
+// //TODO: is only a workaround!!!!
+// Properties props = getGeneralPVP2ProperiesConfig(properies);
+// File dir = new File(props.getProperty("idp.truststore"));
+// File[] files = dir.listFiles();
+// if (files.length > 0) {
+// FileInputStream filestream = new FileInputStream(files[0]);
+// X509Certificate signerCertificate = new X509Certificate(filestream);
+// oa_pvp2.setCertificate(signerCertificate.getEncoded());
+//
+// } else {
+// oa_pvp2.setCertificate(null);
+// }
//moa_oas.add(moa_oa);
ConfigurationDBUtils.save(moa_oa);
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/legacy/ConfigurationBuilder.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/legacy/ConfigurationBuilder.java
index c2898f314..1dfebea03 100644
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/legacy/ConfigurationBuilder.java
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/legacy/ConfigurationBuilder.java
@@ -65,6 +65,7 @@ import at.gv.egovernment.moa.util.BoolUtils;
import at.gv.egovernment.moa.util.Constants;
import at.gv.egovernment.moa.util.DOMUtils;
import at.gv.egovernment.moa.util.FileUtils;
+import at.gv.egovernment.moa.util.MiscUtil;
import at.gv.egovernment.moa.util.StringUtils;
import at.gv.egovernment.moa.util.XPathException;
import at.gv.egovernment.moa.util.XPathUtils;
@@ -406,15 +407,22 @@ public class ConfigurationBuilder {
*/
public String[] loadTransformsInfos(String[] transformsInfoFileNames) throws Exception {
- String[] transformsInfos = new String[transformsInfoFileNames.length];
- for (int i = 0; i < transformsInfoFileNames.length; i++) {
- String fileURL = transformsInfoFileNames[i];
-
- //if fileURL is relative to rootConfigFileDir make it absolute
- fileURL = FileUtils.makeAbsoluteURL(fileURL, rootConfigFileDir_);
- String transformsInfo = FileUtils.readURL(fileURL, DEFAULT_ENCODING);
- transformsInfos[i] = transformsInfo;
- }
+ String[] transformsInfos;
+
+ if (MiscUtil.isNotEmpty(rootConfigFileDir_)) {
+ transformsInfos = new String[transformsInfoFileNames.length];
+ for (int i = 0; i < transformsInfoFileNames.length; i++) {
+ String fileURL = transformsInfoFileNames[i];
+
+ //if fileURL is relative to rootConfigFileDir make it absolute
+ fileURL = FileUtils.makeAbsoluteURL(fileURL, rootConfigFileDir_);
+ String transformsInfo = FileUtils.readURL(fileURL, DEFAULT_ENCODING);
+ transformsInfos[i] = transformsInfo;
+ }
+
+ } else
+ transformsInfos = new String[0];
+
return transformsInfos;
}