JAL-1479 applet build debug
[jalview.git] / src / jalview / ws / sifts / SiftsClient.java
index 4951d2f..32bb7b7 100644 (file)
@@ -96,14 +96,6 @@ public class SiftsClient implements SiftsClientI
 
   private static final String SIFTS_FTP_BASE_URL = "ftp://ftp.ebi.ac.uk/pub/databases/msd/sifts/xml/";
 
-  public static final String DEFAULT_SIFTS_DOWNLOAD_DIR = System
-          .getProperty("user.home")
-          + File.separatorChar
-          + ".sifts_downloads" + File.separatorChar;
-
-  public static final String SIFTS_DOWNLOAD_DIR = jalview.bin.Cache
-          .getDefault("sifts_download_dir", DEFAULT_SIFTS_DOWNLOAD_DIR);
-
   private final static String NEWLINE = System.lineSeparator();
 
   private String curSourceDBRef;
@@ -227,7 +219,8 @@ public class SiftsClient implements SiftsClientI
    */
   public static File getSiftsFile(String pdbId) throws SiftsException
   {
-    File siftsFile = new File(SIFTS_DOWNLOAD_DIR + pdbId.toLowerCase()
+    File siftsFile = new File(SiftsSettings.getSiftDownloadDirectory()
+            + pdbId.toLowerCase()
             + ".xml.gz");
     if (siftsFile.exists())
     {
@@ -252,8 +245,10 @@ public class SiftsClient implements SiftsClientI
   {
     String siftFile = pdbId + ".xml.gz";
     String siftsFileFTPURL = SIFTS_FTP_BASE_URL + siftFile;
-    String downloadedSiftsFile = SIFTS_DOWNLOAD_DIR + siftFile;
-    File siftsDownloadDir = new File(SIFTS_DOWNLOAD_DIR);
+    String downloadedSiftsFile = SiftsSettings.getSiftDownloadDirectory()
+            + siftFile;
+    File siftsDownloadDir = new File(
+            SiftsSettings.getSiftDownloadDirectory());
     if (!siftsDownloadDir.exists())
     {
       siftsDownloadDir.mkdirs();
@@ -291,7 +286,8 @@ public class SiftsClient implements SiftsClientI
    */
   public static boolean deleteSiftsFileByPDBId(String pdbId)
   {
-    File siftsFile = new File(SIFTS_DOWNLOAD_DIR + pdbId.toLowerCase()
+    File siftsFile = new File(SiftsSettings.getSiftDownloadDirectory()
+            + pdbId.toLowerCase()
             + ".xml.gz");
     if (siftsFile.exists())
     {
@@ -322,13 +318,13 @@ public class SiftsClient implements SiftsClientI
     else
     {
       DBRefEntry[] dbRefs = seq.getDBRefs();
-      if (dbRefs == null || dbRefs.length < 1)
-      {
-        final SequenceI[] seqs = new SequenceI[] { seq };
-        new jalview.ws.DBRefFetcher(seqs, null, null, null, false)
-                .fetchDBRefs(true);
-        dbRefs = seq.getDBRefs();
-      }
+      // if (dbRefs == null || dbRefs.length < 1)
+      // {
+      // // final SequenceI[] seqs = new SequenceI[] { seq };
+      // // new jalview.ws.DBRefFetcher(seqs, null, null, null, false)
+      // // .fetchDBRefs(true);
+      // dbRefs = seq.getDBRefs();
+      // }
 
       if (dbRefs == null || dbRefs.length < 1)
       {