+ urls = readIdentifiers(IdOrgSettings.getDownloadLocation());
+ selectedUrls = new ArrayList<String>();
+ checkSelectionMatchesUrls(cachedUrlList);
+ }
+
+ /**
+ * Read data from an identifiers.org download file
+ *
+ * @param idFileName
+ * name of identifiers.org download file
+ * @return hashmap of identifiers.org data, keyed by MIRIAM id
+ */
+ private HashMap<String, UrlLink> readIdentifiers(String idFileName)
+ {
+ JSONParser parser = new JSONParser();
+
+ // identifiers.org data
+ HashMap<String, UrlLink> idData = new HashMap<String, UrlLink>();
+
+ try
+ {
+ FileReader reader = new FileReader(idFileName);
+ String key = "";
+ JSONObject obj = (JSONObject) parser.parse(reader);
+ if (obj.containsKey(ID_ORG_KEY))
+ {
+ key = ID_ORG_KEY;
+ }
+ else if (obj.containsKey(LOCAL_KEY))
+ {
+ key = LOCAL_KEY;
+ }
+ else
+ {
+ System.out.println(
+ "Unexpected key returned from identifiers jalview service");
+ return idData;
+ }