Here you can find the source of readFile(File inputFile)
public static String readFile(File inputFile) throws IOException
//package com.java2s; //License from project: Mozilla Public License import java.io.BufferedReader; import java.io.File; import java.io.FileReader; import java.io.IOException; public class Main { private static final String NEW_LINE = System.getProperty("line.separator"); private static String readFile(BufferedReader input) throws IOException { StringBuilder data = new StringBuilder(); String line = null;// w ww .j a va 2 s. c o m while ((line = input.readLine()) != null) { data.append(line + NEW_LINE); } return data.toString(); } public static String readFile(File inputFile) throws IOException { BufferedReader input = new BufferedReader(new FileReader(inputFile)); return readFile(input); } public static String readFile(String inputFile) throws IOException { BufferedReader input = new BufferedReader(new FileReader(inputFile)); return readFile(input); } }