Here you can find the source of isSymlink(File file)
public static boolean isSymlink(File file) throws IOException
//package com.java2s; //License from project: Apache License import java.io.File; import java.io.IOException; public class Main { private static final char SYSTEM_SEPARATOR = File.separatorChar; public static boolean isSymlink(File file) throws IOException { if (file == null) { throw new NullPointerException("File must not be null"); }/*from w w w . j a va2 s. com*/ if (isSystemWindows()) { return false; } File fileInCanonicalDir = null; if (file.getParent() == null) { fileInCanonicalDir = file; } else { File canonicalDir = file.getParentFile().getCanonicalFile(); fileInCanonicalDir = new File(canonicalDir, file.getName()); } if (fileInCanonicalDir.getCanonicalFile().equals( fileInCanonicalDir.getAbsoluteFile())) { return false; } return true; } static boolean isSystemWindows() { return SYSTEM_SEPARATOR == '\\'; } }