Here you can find the source of loadAsString(String location)
public static String loadAsString(String location)
//package com.java2s; //License from project: Open Source License import java.io.BufferedReader; import java.io.FileReader; public class Main { public static String loadAsString(String location) { final StringBuilder result = new StringBuilder(); try {//from www .ja v a 2 s . c o m final BufferedReader reader = new BufferedReader(new FileReader(location)); String buffer = ""; while ((buffer = reader.readLine()) != null) { result.append(buffer).append("\n"); } reader.close(); } catch (final Exception e) { System.err.println(e); } return result.toString(); } }