Here you can find the source of readFile(final File argFile)
public static List<String> readFile(final File argFile) throws IOException
//package com.java2s; //License from project: GNU General Public License import java.io.BufferedReader; import java.io.File; import java.io.FileReader; import java.io.IOException; import java.util.ArrayList; import java.util.List; public class Main { /** Return a list of Strings, one per line of the file. */ public static List<String> readFile(final File argFile) throws IOException { final BufferedReader br = new BufferedReader(new FileReader(argFile)); String line;// w w w . j a v a 2s . com List<String> lines = new ArrayList<>(); while ((line = br.readLine()) != null) { lines.add(line); } br.close(); return lines; } }