Skip to content

Commit

Permalink
Merge branch 'Aethernal-master'
Browse files Browse the repository at this point in the history
  • Loading branch information
geektortoise committed Jul 31, 2019
2 parents 52eb334 + d921da0 commit c56d4da
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions src/main/java/be/cytomine/client/Cytomine.java
Original file line number Diff line number Diff line change
Expand Up @@ -598,6 +598,40 @@ public ImageInstance getImageInstance(Long id) throws CytomineException {
return fetchModel(image);
}

public String getImageServersOfAbstractImage(Long abstractImageID) {

String subUrl = "/api/abstractimage/"+abstractImageID+"/imageservers.json";

HttpClient client = null;
client = new HttpClient(publicKey, privateKey, getHost());


try {
client.authorize("GET", subUrl, "", "application/json,*/*");
client.connect(getHost() + subUrl);
int code = client.get();

String response = client.getResponseData();
client.disconnect();
JSONObject json = createJSONResponse(code, response);
analyzeCode(code, json);

JSONArray servers = (JSONArray) json.get("imageServersURLs");

return (String) servers.get(0);

} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (CytomineException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}

return null;
}


public ImageServers getImageInstanceServers(ImageInstance image) throws CytomineException {
AbstractImage abstractImage = new AbstractImage();
abstractImage.set("id", image.get("baseImage"));
Expand Down

0 comments on commit c56d4da

Please sign in to comment.