Here you can find the source of readLineFile(String filePath)
public static String readLineFile(String filePath) throws IOException
//package com.java2s; //License from project: Apache License import java.io.*; public class Main { public static String readLineFile(String filePath) throws IOException { StringBuffer sb = new StringBuffer(); FileReader fr = new FileReader(filePath); BufferedReader br = new BufferedReader(fr); String line = br.readLine(); while (line != null) { sb.append(line);/*from w w w.j a v a2 s . c o m*/ line = br.readLine(); } br.close(); fr.close(); return sb.toString(); } }