Here you can find the source of readFileAsString(String filePath)
public static String readFileAsString(String filePath) throws java.io.IOException
//package com.java2s; import java.io.BufferedReader; import java.io.FileReader; public class Main { public static String readFileAsString(String filePath) throws java.io.IOException { BufferedReader reader = new BufferedReader(new FileReader(filePath)); String line;/*from ww w . ja v a 2s . co m*/ String results = ""; while ((line = reader.readLine()) != null) { results += line; } reader.close(); //System.out.println("Config File: " + results); return results; } }