Here you can find the source of readLinesOfFile(String path)
public static List<String> readLinesOfFile(String path) throws IOException
//package com.java2s; //License from project: Open Source License import java.io.IOException; import java.nio.charset.StandardCharsets; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; import java.util.List; public class Main { public static List<String> readLinesOfFile(String path) throws IOException { Path pathToFile = Paths.get(path); return Files.readAllLines(pathToFile, StandardCharsets.US_ASCII); }//from ww w .j av a 2s. c o m }