Here you can find the source of readLines(String string)
public static List<String> readLines(String string)
//package com.java2s; //License from project: Apache 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 { public static List<String> readLines(String string) { File file = new File(string); return readLines(file); }// w ww .j a v a 2 s . c o m public static List<String> readLines(File file) { List<String> lines = new ArrayList<String>(); try { BufferedReader reader = new BufferedReader(new FileReader(file)); String line = null; while ((line = reader.readLine()) != null) { lines.add(line); } } catch (IOException e) { throw new RuntimeException(String.format("Failed to read lines from file '%s'", file.getAbsolutePath()), e); } return lines; } }