From ee4c0c31e98fe5f8600335aea3bfb9034df0e173 Mon Sep 17 00:00:00 2001 From: Ben Soares Date: Mon, 20 May 2024 21:19:21 +0100 Subject: [PATCH] JAL-4409 Also interpret jalviewX:// URIs in Jalview itself (for executable jar or command line start) --- src/jalview/bin/Commands.java | 9 ++++++++- src/jalview/util/HttpUtils.java | 3 ++- 2 files changed, 10 insertions(+), 2 deletions(-) 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 -- 1.7.10.2