Here you can find the source of readUrl(final String url_str)
public static List<String> readUrl(final String url_str) throws IOException
//package com.java2s; // License as published by the Free Software Foundation; either import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.net.URL; import java.net.URLConnection; import java.util.ArrayList; import java.util.List; public class Main { public static List<String> readUrl(final String url_str) throws IOException { final URL url = new URL(url_str); final URLConnection urlc = url.openConnection(); //urlc.setRequestProperty( "User-Agent", "" ); final BufferedReader in = new BufferedReader(new InputStreamReader( urlc.getInputStream())); String line;//from w w w. ja va 2 s . c o m final List<String> result = new ArrayList<String>(); while ((line = in.readLine()) != null) { result.add(line); } in.close(); return result; } }