From: Ben Soares Date: Mon, 20 May 2024 20:19:21 +0000 (+0100) Subject: JAL-4409 Also interpret jalviewX:// URIs in Jalview itself (for executable jar or... X-Git-Tag: Release_2_11_4_0~28^2~14 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=ee4c0c31e98fe5f8600335aea3bfb9034df0e173;p=jalview.git JAL-4409 Also interpret jalviewX:// URIs in Jalview itself (for executable jar or command line start) --- diff --git a/src/jalview/bin/Commands.java b/src/jalview/bin/Commands.java index 5ef32c8..05b987e 100644 --- a/src/jalview/bin/Commands.java +++ b/src/jalview/bin/Commands.java @@ -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; diff --git a/src/jalview/util/HttpUtils.java b/src/jalview/util/HttpUtils.java index e600c6c..c3f32fc 100644 --- a/src/jalview/util/HttpUtils.java +++ b/src/jalview/util/HttpUtils.java @@ -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