Here you can find the source of getStringFromFile(File inputFile)
public static String getStringFromFile(File inputFile) throws IOException
import java.io.*; import java.net.*; import java.util.ArrayList; import java.util.Arrays; import org.apache.commons.lang.Validate; public class Main{ public static String getStringFromFile(String fileName) throws IOException { Validate.notEmpty(fileName);/*from ww w. j a v a2 s.co m*/ return getStringFromFile(new File(fileName)); } public static String getStringFromFile(File inputFile) throws IOException { Validate.notNull(inputFile); Validate.isTrue(inputFile.exists()); return IO.toString(new FileInputStream(inputFile)); } }