public static Stream<String> lines (Path path) throws IOException

Read all lines from a file as a Stream. Bytes from the file are decoded into characters using the UTF-8 charset.

This method works as if invoking it were equivalent to evaluating the expression:


 Files.lines(path, StandardCharsets.UTF_8)
 

Parameters:
path     the path to the file

Returns:  the lines from the file as a Stream

Exceptions:
IOException     if an I/O error occurs opening the file
SecurityException     In the case of the default provider, and a security manager is installed, the checkRead method is invoked to check read access to the file.

Since:  1.8