gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] [libeufin] branch master updated: abort all if XML processo


From: gnunet
Subject: [GNUnet-SVN] [libeufin] branch master updated: abort all if XML processor didn't instantiate.
Date: Mon, 07 Oct 2019 13:05:36 +0200

This is an automated email from the git hooks/post-receive script.

marcello pushed a commit to branch master
in repository libeufin.

The following commit(s) were added to refs/heads/master by this push:
     new 967f378  abort all if XML processor didn't instantiate.
967f378 is described below

commit 967f378ac9f911c7265d994f68315148371733de
Author: Marcello Stanisci <address@hidden>
AuthorDate: Mon Oct 7 13:05:05 2019 +0200

    abort all if XML processor didn't instantiate.
---
 src/main/kotlin/tech/libeufin/Main.kt |  8 +++++++-
 src/main/kotlin/tech/libeufin/XML.kt  | 12 +-----------
 2 files changed, 8 insertions(+), 12 deletions(-)

diff --git a/src/main/kotlin/tech/libeufin/Main.kt 
b/src/main/kotlin/tech/libeufin/Main.kt
index beb4b27..3f2750d 100644
--- a/src/main/kotlin/tech/libeufin/Main.kt
+++ b/src/main/kotlin/tech/libeufin/Main.kt
@@ -43,8 +43,14 @@ import javax.xml.bind.JAXBElement
 
 fun main() {
 
-    val xmlProcess = XML()
     val logger = getLogger()
+    val xmlProcess = XML()
+
+    if (xmlProcess == null) {
+        logger.error("Could not load the XML processor, aborting")
+        return
+    }
+
     dbCreateTables()
 
     val server = embeddedServer(Netty, port = 5000) {
diff --git a/src/main/kotlin/tech/libeufin/XML.kt 
b/src/main/kotlin/tech/libeufin/XML.kt
index a00394d..98d582c 100644
--- a/src/main/kotlin/tech/libeufin/XML.kt
+++ b/src/main/kotlin/tech/libeufin/XML.kt
@@ -54,16 +54,7 @@ class XML {
     private val bundle = {
         val classLoader = ClassLoader.getSystemClassLoader()
         val schemas = arrayOf(
-            // StreamSource(classLoader.getResourceAsStream("ebics_hev.xsd")),
-            // StreamSource(classLoader.getResourceAsStream("ebics_H004.xsd")),
-            // 
StreamSource(classLoader.getResourceAsStream("ebics_orders_H004.xsd")),
-            
StreamSource(classLoader.getResourceAsStream("xmldsig-core-schema.xsd")),
-            
StreamSource(classLoader.getResourceAsStream("ebics_types_H004.xsd")),
-            // 
StreamSource(classLoader.getResourceAsStream("ebics_signature.xsd")),
-            // 
StreamSource(classLoader.getResourceAsStream("ebics_response_H004.xsd")),
-            // 
StreamSource(classLoader.getResourceAsStream("ebics_keymgmt_response_H004.xsd")),
-            
StreamSource(classLoader.getResourceAsStream("ebics_keymgmt_request_H004.xsd"))
-
+            StreamSource(classLoader.getResourceAsStream("ebics_hev.xsd"))
         )
 
         try {
@@ -71,7 +62,6 @@ class XML {
             sf.newSchema(schemas)
         } catch (e: SAXException) {
             e.printStackTrace()
-            // FIXME: must stop everything if schemas fail to load.
             null
         }
     }()

-- 
To stop receiving notification emails like this one, please contact
address@hidden.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]