- URL url = getDivisionsUrl(ensemblGenomesDomain);
- if (url != null)
- {
- br = getHttpResponse(url, null);
- }
- parseResponse(br, ensemblGenomesDomain);
- } catch (IOException e)
- {
- // ignore
- } finally
- {
- if (br != null)
- {
- try
- {
- br.close();
- } catch (IOException e)
- {
- // ignore
- }
- }
- }
- }
-
- /**
- * Parses the JSON response to /info/divisions, and add each to the lookup map
- *
- * @param br
- * @param domain
- */
- void parseResponse(BufferedReader br, String domain)
- {
- JSONParser jp = new JSONParser();
-
- try
- {
- JSONArray parsed = (JSONArray) jp.parse(br);
-
- Iterator rvals = parsed.iterator();
+ @SuppressWarnings("unchecked")
+ Iterator<Object> rvals = (Iterator<Object>) getJSON(getDivisionsUrl(ensemblGenomesDomain), null, -1, MODE_ITERATOR, null);
+ if (rvals == null)
+ return;