package jalview.ws.utils;
-import java.io.ByteArrayInputStream;
+import jalview.util.Platform;
+
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
public class UrlDownloadClient
{
- public UrlDownloadClient()
- {
-
- }
-
/**
* Download and save a file from a URL
*
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);
- */
}
}