The java.io.File methods isDirectory() and isFile() when applied to a symbolic link follow the link and return the boolean value appropriate for the target of the link, but this is not documented in the specification.
The behavior of isHidden() is different on Unix and Windows. On Unix, File.isHidden() (and for that matter Files.isHidden()) applied to a link such as "linkhidden" -> ".hidden" will return false. On Windows however, the returned value reflects the setting of the DOS "hidden" attribute on the target, and both File.isHidden() and Files.isHidden() return true if the target is hidden.
The behavior of isHidden() is different on Unix and Windows. On Unix, File.isHidden() (and for that matter Files.isHidden()) applied to a link such as "linkhidden" -> ".hidden" will return false. On Windows however, the returned value reflects the setting of the DOS "hidden" attribute on the target, and both File.isHidden() and Files.isHidden() return true if the target is hidden.
- csr for
-
JDK-8339868 Behavior of File.is{Directory,File,Hidden} is not documented with respect to symlinks
-
- Closed
-
- relates to
-
JDK-8340229 Improve opening sentence of FileInputStream constructor specification
-
- Resolved
-
- links to
-
Commit(master) openjdk/jdk/64e3a9ee
-
Review(master) openjdk/jdk/20878