Here you can find the source of readFile(String path)
public static String readFile(String path)
//package com.java2s; //License from project: Open Source License import java.util.*; import java.io.*; public class Main { public static String readFile(String path) { return readFile(new File(path)); }// ww w .j av a 2 s . c om public static String readFile(File f) { try { return new Scanner(f, "UTF-8").useDelimiter("\\A").next(); } catch (Exception e) { throw new RuntimeException(e); } } }