JAL-3026 skip unsupported HttpURLConnection methods in JS
authorgmungoc <g.m.carstairs@dundee.ac.uk>
Wed, 31 Oct 2018 15:10:22 +0000 (15:10 +0000)
committergmungoc <g.m.carstairs@dundee.ac.uk>
Wed, 31 Oct 2018 15:10:22 +0000 (15:10 +0000)
src/jalview/ext/ensembl/EnsemblRestClient.java

index f36e111..e3d695f 100644 (file)
@@ -20,6 +20,7 @@
  */
 package jalview.ext.ensembl;
 
+import jalview.bin.Jalview;
 import jalview.io.DataSourceType;
 import jalview.io.FileParse;
 import jalview.util.StringUtils;
@@ -336,12 +337,15 @@ abstract class EnsemblRestClient extends EnsemblSequenceFetcher
             getRequestMimeType(multipleIds));
     connection.setRequestProperty("Accept", getResponseMimeType());
 
-    connection.setUseCaches(false);
     connection.setDoInput(true);
     connection.setDoOutput(multipleIds);
 
-    connection.setConnectTimeout(CONNECT_TIMEOUT_MS);
-    connection.setReadTimeout(readTimeout);
+    if (!Jalview.isJS()) 
+    {
+      connection.setUseCaches(false);
+      connection.setConnectTimeout(CONNECT_TIMEOUT_MS);
+      connection.setReadTimeout(readTimeout);
+    }
 
     if (multipleIds)
     {