+ List<Object> jsonarray = (List<Object>) obj.get(key);
+
+ // loop over each entry in JSON array and build HashMap entry
+ for (int i = 0; i < jsonarray.size(); i++)
+ {
+ Map<String, Object> item = (Map<String, Object>) jsonarray.get(i);
+
+ String url = (String) item.get("url") + "/" + DELIM + DB_ACCESSION
+ + DELIM;
+ UrlLink link = new UrlLink((String) item.get("name"), url,
+ (String) item.get("prefix"));
+ idData.put((String) item.get("id"), link);
+ }
+ } catch (IOException | ParseException e)
+ {
+ // unnecessary e.printStackTrace();
+ // Note how in JavaScript we can grab the first bytes from any file
+ // reader.
+ // Typical report here is "NetworkError" because the file does not exist.
+ // "https://." is coming from System.getProperty("user.home"), but this
+ // could
+ // be set by the page developer to anything, of course.
+ errorMessage = e.toString();
+ idData.clear();
+ }
+ // BH 2018 -- added more valuable report
+ if (errorMessage != null)
+ {
+ System.err.println("IdentifiersUrlProvider: cannot read " + idFileName
+ + ": " + errorMessage);
+ }
+ return idData;