Merge branch 'improvement/JAL-4409_implement_extra_schemes_in_getdown' into develop
[jalview.git] / src / jalview / ws / utils / UrlDownloadClient.java
index 91d88c2..362350d 100644 (file)
@@ -21,8 +21,6 @@
 
 package jalview.ws.utils;
 
-import jalview.util.Platform;
-
 import java.io.File;
 import java.io.FileOutputStream;
 import java.io.IOException;
@@ -34,6 +32,9 @@ import java.nio.file.Path;
 import java.nio.file.Paths;
 import java.nio.file.StandardCopyOption;
 
+import jalview.util.HttpUtils;
+import jalview.util.Platform;
+
 public class UrlDownloadClient
 {
   /**
@@ -57,7 +58,7 @@ public class UrlDownloadClient
       temp = Files.createTempFile(".jalview_", ".tmp");
 
       URL url = new URL(urlstring);
-      rbc = Channels.newChannel(url.openStream());
+      rbc = Channels.newChannel(HttpUtils.openStream(url));
       fos = new FileOutputStream(temp.toString());
       fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE);