Here you can find the source of isSymlink(File file)
public static boolean isSymlink(File file) throws IOException
//package com.java2s; // (as allowed under the Apache License 2.0) import java.io.File; import java.io.IOException; public class Main { public static boolean isSymlink(File file) throws IOException { if (file == null) throw new NullPointerException("File must not be null"); File canon;//from w ww . j a v a 2s.c o m if (file.getParent() == null) { canon = file; } else { File canonDir = file.getParentFile().getCanonicalFile(); canon = new File(canonDir, file.getName()); } return !canon.getCanonicalFile().equals(canon.getAbsoluteFile()); } }