Here you can find the source of getFileContent(String filepath)
public static String getFileContent(String filepath) throws IOException
//package com.java2s; //License from project: Open Source License import java.io.BufferedReader; import java.io.File; import java.io.FileReader; import java.io.IOException; public class Main { public static String getFileContent(String filepath) throws IOException { File f = new File(filepath); BufferedReader reader = new BufferedReader(new FileReader(f)); String line;//from ww w.j a va 2 s . c o m String fileContent = ""; while ((line = reader.readLine()) != null) { fileContent += line; } reader.close(); return fileContent; } }