Here you can find the source of getFileStringContent(String filename)
public static String getFileStringContent(String filename) throws FileNotFoundException
//package com.java2s; import java.io.*; import java.util.Scanner; public class Main { public static String getFileStringContent(String filename) throws FileNotFoundException { String text = new Scanner(new File(filename)).useDelimiter("\\A") .next();// ww w . j a v a 2s .co m return text; } }