8294193: Files.createDirectories throws FileAlreadyExistsException for a symbolic link whose target is an existing directory

Reviewed-by: alanb
This commit is contained in:
Jaikiran Pai 2022-09-26 05:16:31 +00:00
parent 3675f4c2af
commit 169a5d48af
3 changed files with 127 additions and 37 deletions

View file

@ -805,7 +805,7 @@ public final class Files {
try {
createDirectory(dir, attrs);
} catch (FileAlreadyExistsException x) {
if (!isDirectory(dir, LinkOption.NOFOLLOW_LINKS))
if (!isDirectory(dir))
throw x;
}
}