Here you can find the source of isLink(File f)
public static boolean isLink(File f) throws IOException
//package com.java2s; /* Original source code (c) 2013 C. Ivan Cooper. Licensed under GPLv3, see file COPYING for terms. */ import java.io.File; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Paths; public class Main { public static boolean isLink(File f) throws IOException { return Files.isSymbolicLink(Paths.get(f.getPath())); /* if (f.getName().toUpperCase().endsWith(".LNK")) return true;/*from w ww. j a va2s . c o m*/ return ! (f.getAbsolutePath().equals(f.getCanonicalPath()));*/ // this doesn't seem to work on relative paths } }