JAL-4409 Also interpret jalviewX:// URIs in Jalview itself (for executable jar or...
authorBen Soares <b.soares@dundee.ac.uk>
Mon, 20 May 2024 20:19:21 +0000 (21:19 +0100)
committerBen Soares <b.soares@dundee.ac.uk>
Mon, 20 May 2024 20:19:21 +0000 (21:19 +0100)
src/jalview/bin/Commands.java
src/jalview/util/HttpUtils.java

index 5ef32c8..05b987e 100644 (file)
@@ -236,7 +236,10 @@ public class Commands
       {
         Arg a = av.getArg();
         SubVals sv = av.getSubVals();
-        String openFile = av.getValue();
+        String openFile0 = av.getValue();
+        String openFile = HttpUtils.equivalentJalviewUrl(openFile0);
+        if (openFile == null)
+          openFile = openFile0;
         if (openFile == null)
           continue;
 
@@ -317,6 +320,10 @@ public class Commands
           {
             af = fileLoader.LoadFileWaitTillLoaded(openFile, protocol,
                     format);
+            if (!openFile.equals(openFile0))
+            {
+              af.setTitle(openFile0);
+            }
           } catch (Throwable thr)
           {
             xception = true;
index e600c6c..c3f32fc 100644 (file)
@@ -255,7 +255,8 @@ public class HttpUtils
     }
     String scheme = jalviewUri.getScheme();
     String host = jalviewUri.getHost();
-    if (host != null && host.length() > 0)
+    if (host != null && host.length() > 0
+            || scheme.substring(7).startsWith("http"))
     {
       URI newUri;
       try