1 package jalview.javascript.web;
6 * minimal implementation of com.sun.jersey.api.client.ClientResponse
11 public class ClientResponse
14 private String response;
15 private String[] encoding;
17 public ClientResponse(String response, String... encoding)
19 this.response = response;
20 this.encoding = encoding;
23 public String getEntity(Class<?> c)
26 // c will be String.class
31 // https://www.ebi.ac.uk/pdbe/search/pdb/select?wt=json&fl=pdb_id,title,experimental_method,resolution&rows=500&start=0&q=(text:q93xj9_soltu)+AND+molecule_sequence:%5B%27%27+TO+*%5D+AND+status:REL&sort=overall_quality+desc
38 // "q":"(text:q93xj9_soltu) AND molecule_sequence:['' TO *] AND status:REL",
39 // "fl":"pdb_id,title,experimental_method,resolution",
41 // "sort":"overall_quality desc",
44 //"response":{"numFound":1,"start":0,"docs":[
46 // "experimental_method":["X-ray diffraction"],
49 // "title":"The crystal structure of Potato ferredoxin I with 2Fe-2S cluster"}]
53 public int getStatus()
55 // note, we could get the actual response. I am just assuming it is 200 or 400
56 return (response != null && (response.startsWith("{") == encoding[0].equals("application/json"))