Skip to content

[MCLEAN-93] followSymLinks=false on Windows follows directory junctions #174

@jira-importer

Description

@jira-importer

Miłosz S opened MCLEAN-93 and commented

On Windows there are symlinks AND "junctions":

https://docs.microsoft.com/en-us/windows/win32/fileio/hard-links-and-junctions

And java.nio.file.Files.isSymbolicLink() is not detecting junctions, same like org.apache.maven.shared.utils.io.FileUtils from maven-shared-utils. To detect them, you should check for file attributes of given Path:

Path p = Paths.get("C:\\some\\path")
BasicFileAttributes attrs = Files.readAttributes(p, BasicFileAttributes.class, LinkOption.NOFOLLOW_LINKS);
boolean isJunction = attrs.isDirectory() && attrs.isOther();

^Above solution suggested here on JDK JIRA

Related issue: MCLEAN-58


Affects: 2.6.1, 3.0.0, 3.1.0

Remote Links:

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingpriority:majorMajor loss of function

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions