Here you can find the source of isSymlink(File file)
private static boolean isSymlink(File file) throws IOException
//package com.java2s; //License from project: Apache License import com.google.common.base.Preconditions; import java.io.File; import java.io.IOException; public class Main { private static boolean isSymlink(File file) throws IOException { Preconditions.checkNotNull(file); File fileInCanonicalDir = null; if (file.getParent() == null) { fileInCanonicalDir = file;/*ww w. java2s. com*/ } else { fileInCanonicalDir = new File(file.getParentFile().getCanonicalFile(), file.getName()); } return !fileInCanonicalDir.getCanonicalFile().equals(fileInCanonicalDir.getAbsoluteFile()); } }