Here you can find the source of getPageContent(String inputUrlString)
public static String getPageContent(String inputUrlString) throws IOException
//package com.java2s; import java.io.IOException; import java.net.URL; import java.net.URLConnection; import java.util.Scanner; public class Main { private static final String END_OF_INPUT = "\\Z"; public static String getPageContent(String inputUrlString) throws IOException { URL url = new URL(inputUrlString); return getPageContent(url); }/*from www. j a v a2 s. c o m*/ public static String getPageContent(URL inputUrl) throws IOException { String result = null; URLConnection connection = null; connection = inputUrl.openConnection(); Scanner scanner = new Scanner(connection.getInputStream()); scanner.useDelimiter(END_OF_INPUT); result = scanner.next(); return result; } }