1 package jalview.ws.intermine;
3 import jalview.ws.HttpClientUtils;
5 import java.io.IOException;
7 import org.apache.http.client.ClientProtocolException;
10 public class IntermineFetchClient
14 public static enum IntermineDB
16 YeastMine("Yeast Mine", "http://yeastmine.yeastgenome.org/yeastmine"), FlyMine(
17 "Fly Mine", "http://www.flymine.org/query"), FlyMine_Beta(
19 "http://beta.flymine.org/beta"), MouseMine("Mouse Mine",
20 "http://www.mousemine.org/mousemine"), modMine(
22 "http://intermine.modencode.org/modminetest"), RatMine(
23 "Rat Mine", "http://ratmine.mcw.edu/ratmine");
25 private final String name;
26 private final String Url;
28 IntermineDB(String name, String Url)
34 public String getName()
39 public String getURL()
45 public static enum IntermineMethod
47 GET_VERSION("/service/version"), GET_RELEASE("/service/version/release"), GET_FASTA_LIST(
48 "/service/list/results/fasta"), GET_FASTA_QUERY(
49 "/query/results/fasta");
51 private final String target;
53 IntermineMethod(String target)
58 public String getTarget()
65 public static String[] getSupportedDBs()
67 String[] supportedDbs = new String[IntermineDB.values().length];
69 for (IntermineDB db : IntermineDB.values())
71 supportedDbs[count++] = db.getName();
78 public static String fetchData(String url)
79 throws ClientProtocolException, IOException
82 return HttpClientUtils.doHttpUrlGet(url);// client.resource(url).get(String.class);