I forgot, so I checked it. File operations after java7
Path p1 = Paths.get ("sample.dat"); //Paths method
Boolean b = Files.isDirectory(p1); //Files method
System.out.println(b);
Path p1 = Paths.get("sample.dat");
BufferedReader br = Files.newBufferedReader(p1);
String l;
while( (l=br.readLine()) != null){ System.out.println(l); }
Recommended Posts