Here you can find the source of getTextFromURL(final String url)
public static String getTextFromURL(final String url)
//package com.java2s; //License from project: Open Source License import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.net.MalformedURLException; import java.net.URL; import java.net.URLConnection; public class Main { public static String getTextFromURL(final String url) { StringBuilder result = new StringBuilder(); try {/*from w w w . j a v a 2 s.c om*/ final URL website = new URL(url); final URLConnection connection = website.openConnection(); final BufferedReader in = new BufferedReader( new InputStreamReader(connection.getInputStream())); String inputLine; while ((inputLine = in.readLine()) != null) result.append(inputLine); in.close(); } catch (MalformedURLException e) { e.printStackTrace(); //TODO FCRES: Autogenerated, modify } catch (IOException e) { e.printStackTrace(); //TODO FCRES: Autogenerated, modify } return result.toString(); } }