Here you can find the source of load(String filename)
public static final String load(String filename)
//package com.java2s; //License from project: Open Source License import java.io.BufferedReader; import java.io.FileReader; import java.io.IOException; public class Main { public static final String load(String filename) { StringBuilder sb = new StringBuilder(); String line;//from w w w .j a va 2 s . c o m try (BufferedReader br = new BufferedReader( new FileReader(filename))) { while ((line = br.readLine()) != null) { sb.append(line); sb.append(System.lineSeparator()); } } catch (IOException e) { return null; } return sb.toString(); } }