RFR: 8220816: (fs) Files.createDirectory should make it more obvious that it fails when the directory already exists [v3]

Brian Burkhalter bpb at openjdk.org
Wed Nov 19 16:53:10 UTC 2025


On Wed, 19 Nov 2025 10:32:17 GMT, Alan Bateman <alanb at openjdk.org> wrote:

> What do you think of keeping it as simple as "If `dir` locates a file that already exists" ?

That's fine. I previously suggested `{@code dir}` already exists [here](https://cr.openjdk.org/~bpb/8220816/webrev.00/src/java.base/share/classes/java/nio/file/Files.java.udiff.html).

> "Creates a directory, failing if `dir` locates an existing file".

That might work.

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

PR Comment: https://git.openjdk.org/jdk/pull/28378#issuecomment-3553687946


More information about the nio-dev mailing list