RFR: 8339574: Behavior of File.is{Directory,File,Hidden} is not documented with respect to symlinks [v5]

Alan Bateman alanb at openjdk.org
Tue Sep 10 17:36:06 UTC 2024


On Mon, 9 Sep 2024 19:22:19 GMT, Brian Burkhalter <bpb at openjdk.org> wrote:

>> Make explicit how the `java.io.File` methods `isDirectory`, `isFile`, and `isHidden` behave when the `File` represents a symbolic link.
>
> Brian Burkhalter has updated the pull request incrementally with one additional commit since the last revision:
> 
>   8339574: Replace "transparent" with more explicit verbiage

src/java.base/share/classes/java/io/File.java line 1440:

> 1438:      * Renames the file denoted by this abstract pathname.  If this pathname
> 1439:      * denotes a symbolic link, then the link itself, not its target, will be
> 1440:      * renamed.

For FIS/FOS/RAF it's just two constructors in each that follow links so I'm wondering if might be better to put the text there. Also in the case of FOS (and RAF when "w" is in the mode) it will follow the linking when creating (or truncating in the case of FOS) the file and part of wonders if we need to say more on this.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/20878#discussion_r1752389812


More information about the core-libs-dev mailing list