- BufferedReader br = null;
- try
- {
- URL url = getUrl(identifier);
- if (url != null)
- {
- br = getHttpResponse(url, ids);
- }
- return (parseResponse(br));
- } catch (IOException e)
- {
- // ignore
- } finally
- {
- if (br != null)
- {
- try
- {
- br.close();
- } catch (IOException e)
- {
- // ignore
- }
- }
- }
-
- return result;
- }
-
- /**
- * Parses "primary_id" and "dbname" values from the JSON response and
- * constructs a DBRefEntry. Returns a list of the DBRefEntry created. Note we
- * don't parse "synonyms" as they appear to be either redirected or obsolete
- * in Uniprot.
- *
- * @param br
- * @return
- * @throws IOException
- */
- protected List<DBRefEntry> parseResponse(BufferedReader br)
- throws IOException
- {
- JSONParser jp = new JSONParser();
- List<DBRefEntry> result = new ArrayList<DBRefEntry>();