* update these constants when Jalview has been checked / updated for
* changes to Ensembl REST API
* @see https://github.com/Ensembl/ensembl-rest/wiki/Change-log
+ * @see http://rest.ensembl.org/info/rest?content-type=application/json
*/
- private static final String LATEST_ENSEMBLGENOMES_REST_VERSION = "4.4";
+ private static final String LATEST_ENSEMBLGENOMES_REST_VERSION = "4.6";
- private static final String LATEST_ENSEMBL_REST_VERSION = "4.5";
+ private static final String LATEST_ENSEMBL_REST_VERSION = "4.7";
+
+ private static final String REST_CHANGE_LOG = "https://github.com/Ensembl/ensembl-rest/wiki/Change-log";
private static Map<String, EnsemblInfo> domainData;
URL url = getUrl(ids);
BufferedReader reader = getHttpResponse(url, ids);
+ if (reader == null)
+ {
+ // request failed
+ return null;
+ }
FileParse fp = new FileParse(reader, url.toString(), "HTTP_POST");
return fp;
}
writePostBody(connection, ids);
}
- InputStream response = connection.getInputStream();
int responseCode = connection.getResponseCode();
if (responseCode != 200)
* note: a GET request for an invalid id returns an error code e.g. 415
* but POST request returns 200 and an empty Fasta response
*/
- throw new IOException(
- "Response code was not 200. Detected response was "
- + responseCode);
+ System.err.println("Response code " + responseCode + " for " + url);
+ return null;
}
+ // get content
+ InputStream response = connection.getInputStream();
+
// System.out.println(getClass().getName() + " took "
// + (System.currentTimeMillis() - now) + "ms to fetch");
if (laterVersion)
{
System.err.println(String.format(
- "Expected %s REST version %s but found %s", getDbSource(),
- expected,
- version));
+ "Expected %s REST version %s but found %s, see %s",
+ getDbSource(), expected, version, REST_CHANGE_LOG));
}
info.restVersion = version;
} catch (Throwable t)