JAL-4409 Adjust usage of HttpUtils.equivalentJalviewURLString() and pass jalviewX...
authorBen Soares <b.soares@dundee.ac.uk>
Tue, 21 May 2024 15:31:00 +0000 (16:31 +0100)
committerBen Soares <b.soares@dundee.ac.uk>
Tue, 21 May 2024 15:31:00 +0000 (16:31 +0100)
getdown/lib/getdown-core.jar
getdown/lib/getdown-launcher-local.jar
getdown/lib/getdown-launcher.jar
getdown/src/getdown/core/src/main/java/com/threerings/getdown/data/Application.java
getdown/src/getdown/core/src/main/java/com/threerings/getdown/data/EnvConfig.java
getdown/src/getdown/core/src/main/java/jalview/util/HttpUtils.java
getdown/src/getdown/launcher/src/main/java/com/threerings/getdown/launcher/GetdownApp.java
j11lib/getdown-core.jar
j8lib/getdown-core.jar

index ee0eb50..9a6626f 100644 (file)
Binary files a/getdown/lib/getdown-core.jar and b/getdown/lib/getdown-core.jar differ
index 1d9e388..3ba56f5 100644 (file)
Binary files a/getdown/lib/getdown-launcher-local.jar and b/getdown/lib/getdown-launcher-local.jar differ
index a2c6470..e6b43ab 100644 (file)
Binary files a/getdown/lib/getdown-launcher.jar and b/getdown/lib/getdown-launcher.jar differ
index f063a18..fca6b4d 100644 (file)
@@ -1120,16 +1120,18 @@ public class Application
         if (! StringUtil.isBlank(_jalviewUri)) {
           _appargs.add(0, _jalviewUri);
         }
+        /* don't convert jalviewX:// URIs to https:// URLs as Jalview can now do that
         if (_appargs.size() > 0) {
           String jalviewUri = _appargs.get(0);
           log.info("Trying to parse uri '"+jalviewUri+"'");
-          String jalviewUrl = HttpUtils.equivalentJalviewUrl(jalviewUri);
-          if (jalviewUrl != null) {
+          if (HttpUtils.isJalviewSchemeUri(jalviewUri)) {
+            String jalviewUrl = HttpUtils.equivalentJalviewUrl(jalviewUri);
             log.info("Turned url '"+jalviewUri+"' into '"+jalviewUrl+"'");
             _appargs.clear();
             _appargs.add(jalviewUrl);
           }
         }
+        */
         
         for (String argString: _appargs) {
           if (argString.startsWith("-jvmmempc=")) {
@@ -1948,14 +1950,17 @@ public class Application
             filename = p;
           }
           
+          /* Now letting Jalview convert these URIs.
           // convert jalviewX://... URLs
           if (HttpUtils.isJalviewSchemeUri(filename)) {
             filename = HttpUtils.equivalentJalviewUrl(filename);
           }
+          */
 
           // check for locator file.  Only allow one locator file to be double clicked (if multiple files opened, ignore locator files)
           if (filename.toLowerCase(Locale.ROOT).endsWith("."+Application.LOCATOR_FILE_EXTENSION)) {
-            setLocatorFile(filename);
+            // convert jalviewX://... JVL files
+            setLocatorFile(HttpUtils.equivalentJalviewUrl(filename));
           } else {
             // skip any other locator files in a multiple file list
             addStartupFile(filename);
@@ -1973,7 +1978,7 @@ public class Application
         } else {
           sb.append(' ');
         }
-        String p = changeJalviewSchemeUris && HttpUtils.isJalviewSchemeUri(f) ? HttpUtils.equivalentJalviewUrl(f) : f;
+        String p = changeJalviewSchemeUris ? HttpUtils.equivalentJalviewUrl(f) : f;
         if (p.contains(" ")) {
           sb.append('"');
           sb.append(p);
index e3993d3..862c18e 100644 (file)
@@ -150,9 +150,7 @@ public final class EnvConfig {
         String argvLocatorFilename = argv.length > 2 ? argv[2] : null;
         if (!StringUtil.isBlank(argvLocatorFilename)
               && argvLocatorFilename.toLowerCase(Locale.ROOT).endsWith("."+Application.LOCATOR_FILE_EXTENSION)) {
-          if (HttpUtils.isJalviewSchemeUri(argvLocatorFilename)) {
-            argvLocatorFilename = HttpUtils.equivalentJalviewUrl(argvLocatorFilename);
-          }
+          argvLocatorFilename = HttpUtils.equivalentJalviewUrl(argvLocatorFilename);
           notes.add(Note.info("locatorFilename in args: '"+argv[2]+"'"));
           Application.setLocatorFile(argvLocatorFilename);
           
index e600c6c..04a820d 100644 (file)
@@ -243,7 +243,8 @@ public class HttpUtils
   {
     if (!isJalviewSchemeUri(jalviewUriString))
     {
-      return null;
+      // not a jalviewUriString, hand it back
+      return jalviewUriString;
     }
     URI jalviewUri;
     try
@@ -255,7 +256,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
index 31b2538..3eb9450 100644 (file)
@@ -311,7 +311,7 @@ public class GetdownApp
       } else {
         sb.append(' ');
       }
-      String p = changeJalviewSchemeUris && HttpUtils.isJalviewSchemeUri(f) ? HttpUtils.equivalentJalviewUrl(f) : f;
+      String p = changeJalviewSchemeUris ? HttpUtils.equivalentJalviewUrl(f) : f;
       if (p.contains(" ")) {
         sb.append('"');
         sb.append(p);
index ee0eb50..9a6626f 100644 (file)
Binary files a/j11lib/getdown-core.jar and b/j11lib/getdown-core.jar differ
index ee0eb50..9a6626f 100644 (file)
Binary files a/j8lib/getdown-core.jar and b/j8lib/getdown-core.jar differ