class HttpUtils {

    public String executeHttpGetRequest(URL url) throws IOException {
        HttpURLConnection con = (HttpURLConnection)url.openConnection();
        con.setRequestMethod("GET");
        int responseCode = con.getResponseCode();
        if (responseCode != 200) {
            return String.format("Error in HTTP GET : code [%d]", responseCode);
        }
        StringWriter output = new StringWriter();
        IOUtils.copy(con.getInputStream(), output);
        return output.toString();
    }

}