import java.io.IOException;
-import javax.ws.rs.core.MultivaluedMap;
-
import org.apache.http.client.ClientProtocolException;
-import com.sun.jersey.api.client.Client;
public class IntermineFetchClient
{
- private static final Client client = Client.create();
public static enum IntermineDB
{
}
- public static String fetchData(IntermineDB Database,
- IntermineMethod method, MultivaluedMap<String, String> params)
- {
- String response = "";
- if (params.isEmpty())
- {
-
- response = client.resource(Database.getURL() + method.getTarget())
- .accept("text/plain")
- .get(String.class);
-
- }
- else
- {
- response = client.resource(Database.getURL() + method.getTarget())
- .queryParams(params)
- .get(String.class);
- }
- return response;
- }
public static String fetchData(String url)
throws ClientProtocolException, IOException