JAL-3813 NOIDENTIFIERSSERVICE preference disables jalview pinging www.jalview.org...
authorJim Procter <jprocter@issues.jalview.org>
Fri, 5 Feb 2021 17:07:18 +0000 (17:07 +0000)
committerJim Procter <jprocter@issues.jalview.org>
Fri, 5 Feb 2021 17:07:18 +0000 (17:07 +0000)
src/jalview/bin/Cache.java
src/jalview/gui/Desktop.java
src/jalview/ws/utils/UrlDownloadClient.java

index 9e51d67..579b490 100755 (executable)
@@ -196,11 +196,13 @@ import jalview.ws.sifts.SiftsSettings;
  * <li>CHIMERA_PATH specify full path to Chimera program (if non-standard)</li>
  * <li>ID_ORG_HOSTURL location of jalview service providing identifiers.org urls
  * </li>
- * 
  * <li>NONEWS - when set disables Jalview News from automatically appearing</li>
  * <li>NOHTMLTEMPLATES - when set, the
  * https://github.com/jalview/exporter-templates/tree/master/biojs repository is
  * not downloaded automatically</li>
+ * <li>NOIDENTIFIERSSERVICE - when set, jalview won't automatically download
+ * available URL linkouts via www.jalview.org/services/identifiers</li>
+ * <li>
  * </ul>
  * Deprecated settings:
  * <ul>
index f06adc4..21a0e37 100644 (file)
@@ -559,26 +559,27 @@ public class Desktop extends jalview.jbgui.GDesktop
 
   public void getIdentifiersOrgData()
   {
-    // Thread off the identifiers fetcher
-    new Thread(new Runnable()
-    {
-      @Override
-      public void run()
+    if (Cache.getProperty("NOIDENTIFIERSSERVICE") == null)
+    {// Thread off the identifiers fetcher
+      new Thread(new Runnable()
       {
-        Cache.log.debug("Downloading data from identifiers.org");
-        UrlDownloadClient client = new UrlDownloadClient();
-        try
-        {
-          client.download(IdOrgSettings.getUrl(),
-                  IdOrgSettings.getDownloadLocation());
-        } catch (IOException e)
+        @Override
+        public void run()
         {
-          Cache.log.debug("Exception downloading identifiers.org data"
-                  + e.getMessage());
+          Cache.log.debug("Downloading data from identifiers.org");
+          try
+          {
+            UrlDownloadClient.download(IdOrgSettings.getUrl(),
+                    IdOrgSettings.getDownloadLocation());
+          } catch (IOException e)
+          {
+            Cache.log.debug("Exception downloading identifiers.org data"
+                    + e.getMessage());
+          }
         }
-      }
-    }).start();
-    ;
+      }).start();
+      ;
+    }
   }
 
   @Override
index 448edd9..e42c21e 100644 (file)
@@ -33,11 +33,6 @@ import java.nio.file.StandardCopyOption;
 
 public class UrlDownloadClient
 {
-  public UrlDownloadClient()
-  {
-
-  }
-
   /**
    * Download and save a file from a URL
    *