JAL-2316 Restructure identifiers.org download
[jalview.git] / src / jalview / bin / Cache.java
index 0972ced..fe21406 100755 (executable)
@@ -22,6 +22,7 @@ package jalview.bin;
 
 import jalview.datamodel.PDBEntry;
 import jalview.structure.StructureImportSettings;
+import jalview.urls.IdOrgSettings;
 import jalview.ws.dbsources.das.api.DasSourceRegistryI;
 import jalview.ws.dbsources.das.datamodel.DasSourceRegistry;
 import jalview.ws.sifts.SiftsSettings;
@@ -220,6 +221,9 @@ public class Cache
 
   public static final String DAS_ACTIVE_SOURCE = "DAS_ACTIVE_SOURCE";
 
+  /**
+   * Sifts settings
+   */
   public static final String DEFAULT_SIFTS_DOWNLOAD_DIR = System
           .getProperty("user.home")
           + File.separatorChar
@@ -228,13 +232,23 @@ public class Cache
   private final static String DEFAULT_CACHE_THRESHOLD_IN_DAYS = "2";
 
   private final static String DEFAULT_FAIL_SAFE_PID_THRESHOLD = "30";
-  
+
+  /**
+   * Identifiers.org download settings
+   */
+  private static final String ID_ORG_FILE = System.getProperty("user.home")
+          + File.separatorChar + ".jalview_identifiers";
+
+  private static final String ID_ORG_URL = "http://identifiers.org/rest/collections/";
+
   /**
    * Allowed values are PDB or mmCIF
    */
   private final static String PDB_DOWNLOAD_FORMAT = PDBEntry.Type.MMCIF
           .toString();
 
+  private final static String DEFAULT_PDB_FILE_PARSER = StructureImportSettings.StructureParser.JMOL_PARSER
+          .toString();
 
   /*
    * a date formatter using a fixed (rather than the user's) locale; 
@@ -438,13 +452,19 @@ public class Cache
             "sifts_cache_threshold_in_days",
             DEFAULT_CACHE_THRESHOLD_IN_DAYS));
 
+    IdOrgSettings.setUrl(ID_ORG_URL);
+    IdOrgSettings.setDownloadLocation(ID_ORG_FILE);
+
     System.out
             .println("Jalview Version: " + codeVersion + codeInstallation);
 
     StructureImportSettings.setDefaultStructureFileFormat(jalview.bin.Cache
-            .getDefault(
-"PDB_DOWNLOAD_FORMAT", PDB_DOWNLOAD_FORMAT));
-
+            .getDefault("PDB_DOWNLOAD_FORMAT", PDB_DOWNLOAD_FORMAT));
+    StructureImportSettings
+            .setDefaultPDBFileParser(DEFAULT_PDB_FILE_PARSER);
+    // StructureImportSettings
+    // .setDefaultPDBFileParser(jalview.bin.Cache.getDefault(
+    // "DEFAULT_PDB_FILE_PARSER", DEFAULT_PDB_FILE_PARSER));
     // jnlpVersion will be null if we're using InstallAnywhere
     // Dont do this check if running in headless mode
     if (jnlpVersion == null
@@ -890,7 +910,7 @@ public class Cache
   {
     setProperty(property, jalview.util.Format.getHexString(colour));
   }
-  
+
   /**
    * Stores a formatted date in a jalview property, using a fixed locale.
    *