/** * Determines whether the specified file is a symbolic link rather than an actual file. * Always returns <code>false</code> on Windows. */ public static boolean isSymlink(final File file) throws IOException { if (SystemUtil.isHostWindows()) { return false; } File fileInCanonicalDir; if (file.getParent() == null) { fileInCanonicalDir = file; } else { File canonicalDir = file.getParentFile().getCanonicalFile(); fileInCanonicalDir = new File(canonicalDir, file.getName()); } return !fileInCanonicalDir.getCanonicalFile().equals(fileInCanonicalDir.getAbsoluteFile()); }