<<< Creating directory | Index | Displaying files in a directory >>> |
Code that displays information about a file
System.out.println("File name: " + filePath.getFileName()); System.out.println("Absolute path: " + filePath.toAbsolutePath()); System.out.println("Is writable: " + Files.isWritable(filePath));
Resulting output:
File name: myfile.txt Absolute path: c:\java\files\myfile.txt Is writable: true
<<< Creating directory | Index | Displaying files in a directory >>> |