1 package jalview.javascript.web;
5 public class ClientResponse
8 private String response;
9 private String[] encoding;
11 public ClientResponse(String response, String... encoding)
13 this.response = response;
14 this.encoding = encoding;
17 public String getEntity(Class<?> c)
20 // c will be String.class
25 // 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
32 // "q":"(text:q93xj9_soltu) AND molecule_sequence:['' TO *] AND status:REL",
33 // "fl":"pdb_id,title,experimental_method,resolution",
35 // "sort":"overall_quality desc",
38 //"response":{"numFound":1,"start":0,"docs":[
40 // "experimental_method":["X-ray diffraction"],
43 // "title":"The crystal structure of Potato ferredoxin I with 2Fe-2S cluster"}]
47 public int getStatus()
49 // note, we could get the actual response. I am just assuming it is 200 or 400
50 return (response != null && (response.startsWith("{") == encoding[0].equals("application/json"))