The end result is not too surprising:
java.nio.file.Files.isWritable(java.nio.file.Paths.get(fn)) => false
new java.io.File(fn).canWrite() => true
File.canWrite does not pay attention to the ACL at all and only checks the read attribute for MS-DOS only.
Files.isWriteable pays attention to the ACL, but for some reason (to break the broken programs?) They left the File.canWrite file uncommitted. This turns out to be successful, because in some situations it seems that it can return false, even if you can open the file without any problems.
Indeed, I would generalize the following methods:
- File.canWrite true, .
- Files.isWriteable false, .
, . , , , , , , .