Here you can find the source of getFileContent(File file)
public static String getFileContent(File file) throws IOException
//package com.java2s; import java.io.File; import java.io.FileReader; import java.io.IOException; public class Main { public static String getFileContent(File file) throws IOException { FileReader reader = new FileReader(file); char[] content = new char[(int) file.length()]; reader.read(content, 0, content.length); return new String(content); }/*from ww w . j a va2s. c o m*/ }