Here you can find the source of readLinesFromFile(Path path)
public static List<String> readLinesFromFile(Path path)
//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.util.List; public class Main { public static List<String> readLinesFromFile(Path path) { try {/*from w ww . j a va 2s .c om*/ return Files.readAllLines(path, StandardCharsets.UTF_8); } catch (IOException e) { throw new UnsupportedOperationException("Could not read from file '" + path + "'", e); } } }