https://bz.apache.org/bugzilla/show_bug.cgi?id=66293
Bug ID: 66293
Summary: Ant doesn't detect windows junctions as symlinks
Product: Ant
Version: 1.10.5
Hardware: PC
Status: NEW
Severity: normal
Priority: P2
Component: Core
Assignee: [email protected]
Reporter: [email protected]
Target Milestone: ---
When a directory is a Windows NTFS Junction, Ant does not recognize it as a
symbolic link.
I think this used to work in Ant 1.9.x (not tested though), but it is broken
since the refactoring to use the Files.isSymbolicLink method. This method
doesn't detect NTFS Junctions.
Possible solutions to detect junctions are described in this post:
https://stackoverflow.com/questions/13733275/determine-whether-a-file-is-a-junction-in-windows-or-not
For instance:
boolean isWindows =
System.getProperty("os.name").toLowerCase().contains("windows")
BasicFileAttributes attrs = Files.readAttributes(aPath,
BasicFileAttributes.class, LinkOption.NOFOLLOW_LINKS);
boolean isJunction = isWindows && attrs.isDirectory() && attrs.isOther();
Maarten
--
You are receiving this mail because:
You are the assignee for the bug.