Here you can find the source of loadToStringListFromFile(String fullFileName)
public static List<String> loadToStringListFromFile(String fullFileName) throws Exception
//package com.java2s; /*/*from w ww . jav a 2 s . co m*/ * This software is distributed under the terms of the FSF * Gnu Lesser General Public License (see lgpl.txt). * * This program is distributed WITHOUT ANY WARRANTY. See the * GNU General Public License for more details. */ import java.io.BufferedReader; import java.io.FileInputStream; import java.io.InputStreamReader; import java.util.ArrayList; import java.util.List; public class Main { public static List<String> loadToStringListFromFile(String fullFileName) throws Exception { List<String> lines = new ArrayList<String>(); BufferedReader br = null; try { br = new BufferedReader(new InputStreamReader( new FileInputStream(fullFileName), "utf-8")); while (true) { String line = br.readLine(); if (line == null) break; lines.add(line); } } catch (Exception ex) { throw ex; } finally { try { if (br != null) br.close(); } catch (Exception ex) { } } return lines; } }