JAL-3746 JAL-3813 NOIDENTIFIERSSERVICE preference disables jalview pinging www.jalvie...
[jalview.git] / src / jalview / ws / utils / UrlDownloadClient.java
index cfe080c..235d271 100644 (file)
@@ -21,7 +21,8 @@
 
 package jalview.ws.utils;
 
-import java.io.ByteArrayInputStream;
+import jalview.util.Platform;
+
 import java.io.File;
 import java.io.FileOutputStream;
 import java.io.IOException;
@@ -35,11 +36,6 @@ import java.nio.file.StandardCopyOption;
 
 public class UrlDownloadClient
 {
-  public UrlDownloadClient()
-  {
-
-  }
-
   /**
    * Download and save a file from a URL
    * 
@@ -114,13 +110,9 @@ public class UrlDownloadClient
 
   public static void download(String urlstring, File tempFile) throws IOException
   {
-    if (/** @j2sNative 1?false: */true) {
+    if (!Platform.setFileBytes(tempFile, urlstring))
+    {
       download(urlstring, tempFile.toString());
     }
-    // JavaScript only
-
-    /** @j2sNative 
-     * tempFile._bytes = swingjs.JSUtil.getFileAsBytes(urlstring); 
-     */
   }
 }