Here you can find the source of isLink(File file)
public static boolean isLink(File file)
//package com.java2s; //License from project: Open Source License import java.io.File; import java.io.IOException; public class Main { public static boolean isLink(File file) {//not pure yet try {// www. jav a2s. c o m if (!file.exists()) { return true; } else { String cnnpath = file.getCanonicalPath(); String abspath = file.getAbsolutePath(); return !abspath.equals(cnnpath); } } catch (IOException ex) { System.err.println(ex); return true; } } }