Here you can find the source of getURLString(String urlStr)
public static String getURLString(String urlStr)
//package com.java2s; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.net.MalformedURLException; import java.net.URL; public class Main { public static String getURLString(String urlStr) { try {/*from w w w.j a v a 2s.c o m*/ URL url = new URL(urlStr); BufferedReader in = new BufferedReader(new InputStreamReader( url.openStream())); String inputLine; String json = ""; while ((inputLine = in.readLine()) != null) json += inputLine; in.close(); return json; } catch (MalformedURLException e) { } catch (IOException e) { } return null; } }