Java tutorial
//package com.java2s; import java.io.File; import java.io.IOException; public class Main { public static boolean isSymboliclink(File file) throws IOException { File canon; if (file.getParent() == null) { canon = file; } else { File canonDir = file.getParentFile().getCanonicalFile(); canon = new File(canonDir, file.getName()); } return !canon.getCanonicalFile().equals(canon.getAbsoluteFile()); } }