From a77097b69158a4b1d5cc518d6920831cad85ee7c Mon Sep 17 00:00:00 2001 From: James Procter Date: Thu, 2 Feb 2023 16:46:20 +0000 Subject: [PATCH] JAL-4119 use split_xml directories rather than the single path --- src/jalview/ws/sifts/SiftsClient.java | 9 +++++++-- test/jalview/ws/sifts/SiftsClientTest.java | 6 ++++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/jalview/ws/sifts/SiftsClient.java b/src/jalview/ws/sifts/SiftsClient.java index 0c707e5..037854b 100644 --- a/src/jalview/ws/sifts/SiftsClient.java +++ b/src/jalview/ws/sifts/SiftsClient.java @@ -116,7 +116,7 @@ public class SiftsClient implements SiftsClientI private static final String NOT_OBSERVED = "Not_Observed"; - private static final String SIFTS_FTP_BASE_URL = "http://ftp.ebi.ac.uk/pub/databases/msd/sifts/xml/"; + private static final String SIFTS_SPLIT_FTP_BASE_URL = "https://ftp.ebi.ac.uk/pub/databases/msd/sifts/split_xml/"; private final static String NEWLINE = System.lineSeparator(); @@ -305,7 +305,7 @@ public class SiftsClient implements SiftsClientI pdbId = pdbId.replace(".cif", ""); } String siftFile = pdbId + ".xml.gz"; - String siftsFileFTPURL = SIFTS_FTP_BASE_URL + siftFile; + String siftsFileFTPURL = getDownloadUrlFor(siftFile); /* * Download the file from URL to either @@ -348,6 +348,11 @@ public class SiftsClient implements SiftsClientI return downloadTo; } + public static String getDownloadUrlFor(String siftFile) + { + return SIFTS_SPLIT_FTP_BASE_URL +siftFile.substring(1, 3)+"/"+siftFile; + } + /** * Delete the SIFTs file for the given PDB Id in the local SIFTs download * directory diff --git a/test/jalview/ws/sifts/SiftsClientTest.java b/test/jalview/ws/sifts/SiftsClientTest.java index 44a6a02..b003cb5 100644 --- a/test/jalview/ws/sifts/SiftsClientTest.java +++ b/test/jalview/ws/sifts/SiftsClientTest.java @@ -205,6 +205,12 @@ public class SiftsClientTest { siftsClient = null; } + + @Test(groups= {"Functional"}) + public void testSIFTsDownloadURL() { + String expectedUrl = "https://ftp.ebi.ac.uk/pub/databases/msd/sifts/split_xml/xy/1xyz.sifts.xml.gz"; + Assert.assertEquals(SiftsClient.getDownloadUrlFor("1xyz.sifts.xml.gz"), expectedUrl); + } @Test(groups = { "Network" }) public void getSIFTsFileTest() throws SiftsException, IOException -- 1.7.10.2