Java examples for File Path IO:Path
Read from file in Path type with buffered reader
import java.io.BufferedReader; import java.io.IOException; import java.nio.charset.Charset; import java.nio.file.Files; import java.nio.file.Path; public class Main { public static void main(String[] args) { Path path = null;//from ww w . ja va 2 s. c o m try (BufferedReader inputReader = Files.newBufferedReader(path, Charset.defaultCharset())) { String inputLine; while ((inputLine = inputReader.readLine()) != null) { System.out.println(inputLine); } } catch (IOException ex) { ex.printStackTrace(); } } }