Here you can find the source of isSymlink(final String path)
public static boolean isSymlink(final String path) throws IOException
//package com.java2s; //License from project: Apache License import java.io.File; import java.io.IOException; public class Main { public static boolean isSymlink(final String path) throws IOException { final File file = new File(path); final File fileInCanonicalDir; if (file.getParent() == null) { fileInCanonicalDir = file;/*from www .j av a2s . com*/ } else { fileInCanonicalDir = new File(file.getParentFile().getCanonicalFile(), file.getName()); } final File canonicalFile = fileInCanonicalDir.getCanonicalFile(); final File absoluteFile = fileInCanonicalDir.getAbsoluteFile(); return !canonicalFile.equals(absoluteFile); } }