I was able to reproduce this under the following specific circumstances:
- The OS is Windows (implied by the path syntax)
- The path refers to a directory
- The directory is read-only or, the user does not have "List Folder Contents" permission.
I tested this on Linux (Centos 6) and cannot reproduce it even when changing the filemode on the directory (i.e. chmod -x /aaa/bbb/ccc
or chmod -r /aaa/bbb/ccc
)
So this appears to occur only on Windows. There must be some difference between how java.io
and java.nio.file
implement existence testing with regards to file permissions on Windows.
Check the permissions on the directory.
This may be a bug worth reporting.