From: gmungoc Date: Thu, 28 Sep 2017 15:51:30 +0000 (+0100) Subject: JAL-2745 update www.ebi.ac.uk to https X-Git-Tag: Release_2_10_2b2^2~9 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=2467c106c4be8b70f244a160739be63efc6b58ea;hp=6af8a1bf63beb54937489a0298eaef5c72bf8c60;p=jalview.git JAL-2745 update www.ebi.ac.uk to https --- diff --git a/src/jalview/fts/service/pdb/PDBFTSRestClient.java b/src/jalview/fts/service/pdb/PDBFTSRestClient.java index a483f44..cbeaff1 100644 --- a/src/jalview/fts/service/pdb/PDBFTSRestClient.java +++ b/src/jalview/fts/service/pdb/PDBFTSRestClient.java @@ -59,7 +59,7 @@ public class PDBFTSRestClient extends FTSRestClient private static FTSRestClientI instance = null; - public static final String PDB_SEARCH_ENDPOINT = "http://www.ebi.ac.uk/pdbe/search/pdb/select?"; + public static final String PDB_SEARCH_ENDPOINT = "https://www.ebi.ac.uk/pdbe/search/pdb/select?"; protected PDBFTSRestClient() { diff --git a/src/jalview/ws/ebi/EBIFetchClient.java b/src/jalview/ws/ebi/EBIFetchClient.java index 3e8c55e..50151d9 100644 --- a/src/jalview/ws/ebi/EBIFetchClient.java +++ b/src/jalview/ws/ebi/EBIFetchClient.java @@ -29,6 +29,7 @@ import java.io.File; import java.io.FileOutputStream; import java.io.InputStream; import java.io.InputStreamReader; +import java.net.HttpURLConnection; import java.net.URL; import java.util.ArrayList; import java.util.List; @@ -205,7 +206,14 @@ public class EBIFetchClient { URL rcall = new URL(url); - InputStream is = new BufferedInputStream(rcall.openStream()); + HttpURLConnection conn = (HttpURLConnection) rcall.openConnection(); + int responseCode = conn.getResponseCode(); + if (responseCode != 200) + { + System.out.println("Warning: response code " + responseCode + + " for " + url); + } + InputStream is = new BufferedInputStream(conn.getInputStream()); if (outFile != null) { FileOutputStream fio = new FileOutputStream(outFile); @@ -267,12 +275,12 @@ public class EBIFetchClient if (database.equalsIgnoreCase(DBRefSource.EMBL) || database.equalsIgnoreCase(DBRefSource.EMBLCDS)) { - url = "http://www.ebi.ac.uk/ena/data/view/" + ids.toLowerCase() + url = "https://www.ebi.ac.uk/ena/data/view/" + ids.toLowerCase() + (format != null ? "&" + format : ""); } else { - url = "http://www.ebi.ac.uk/Tools/dbfetch/dbfetch/" + url = "https://www.ebi.ac.uk/Tools/dbfetch/dbfetch/" + database.toLowerCase() + "/" + ids.toLowerCase() + (format != null ? "/" + format : ""); }