-
Notifications
You must be signed in to change notification settings - Fork 55
Closed
Labels
bugSomething isn't workingSomething isn't workingpriority:majorMajor loss of functionMajor loss of function
Milestone
Description
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:
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingpriority:majorMajor loss of functionMajor loss of function