Here you can find the source of getFileContent(File f)
public static StringBuilder getFileContent(File f)
//package com.java2s; import java.io.BufferedReader; import java.io.File; import java.io.FileReader; import java.io.IOException; public class Main { public static StringBuilder getFileContent(File f) { StringBuilder tmp = new StringBuilder(); try {//from ww w . j a v a2 s . c om @SuppressWarnings("resource") BufferedReader br = new BufferedReader(new FileReader(f)); String line; while ((line = br.readLine()) != null) { tmp.append(line); tmp.append("\n"); } } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } return tmp; } }