JAL-3850 using reflection for SimpleHttpFileServerFactory
authorBen Soares <bsoares@dundee.ac.uk>
Wed, 21 Jul 2021 11:32:31 +0000 (12:32 +0100)
committerBen Soares <bsoares@dundee.ac.uk>
Wed, 21 Jul 2021 11:32:31 +0000 (12:32 +0100)
build.gradle

index 41a972b..56140e6 100644 (file)
@@ -2947,7 +2947,13 @@ task jalviewjsServer {
   def htmlFile = "${jalviewDirAbsolutePath}/${filename}"
   doLast {
 
-    SimpleHttpFileServerFactory factory = new SimpleHttpFileServerFactory()
+    def factory
+    try {
+      def class = Class.forName("SimpleHttpFileServerFactory")
+      factory = class.newInstance()
+    } catch (ClassNotFoundException e) {
+      throw new GradleException("Unable to create SimpleHttpFileServerFactory")
+    }
     def port = Integer.valueOf(jalviewjs_server_port)
     def start = port
     def running = false