In java, a symbolic link in a Unix environment can be detected by comparing the file's canonical and absolute path. However, this trick does not work on windows. If I execute
mkdir c:\foo
mklink /j c:\bar
from the command line and then execute the following lines in java
File f = new File("C:/bar");
System.out.println(f.getAbsolutePath());
System.out.println(f.getCanonicalPath());
the output is
C:\bar
C:\bar
Is there any pre-Java 7 way of detecting a junction in windows?