Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8339574

Behavior of File.is{Directory,File,Hidden} is not documented with respect to symlinks

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 24
    • 24
    • core-libs
    • b16
    • generic
    • generic

      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.

            bpb Brian Burkhalter
            bpb Brian Burkhalter
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: