Here you can find the source of downloadString(String url)
public static String downloadString(String url)
//package com.java2s; //License from project: Open Source License import java.io.*; import java.net.*; public class Main { public static String downloadString(String url) { String s = null;/* w w w. java 2 s.c o m*/ try { BufferedReader reader = new BufferedReader(new InputStreamReader(new URL(url).openStream())); String ss; while ((ss = reader.readLine()) != null) s += ss; } catch (IOException ex) { ex.printStackTrace(); } return s; } }