if (!file.exists()) { File parent = file.getParentFile(); String[] children = parent.list(); if (children != null) { for (int i = 0; i < children.length; i++) { if (children[i].equals(file.getName())) { return true; } } } return false; } else { try { return !file.getAbsolutePath().equals(file.getCanonicalPath()); } catch (IOException e) { } } return false;
String line = execCommand(new String[] {"ls", "-l"}); return line != null && line.startsWith("l");
    public static boolean isSymlink(File file) {        if (isWindows || file == null) {            return false;        }        if (!file.exists()) {            File parent = file.getParentFile();            String[] children = parent.list();            if (children != null) {                for (int i = 0; i < children.length; i++) {                    if (children[i].equals(file.getName())) {                        return true;                    }                }            }            return false;        } else {            try {                return !file.getAbsolutePath().equals(file.getCanonicalPath());            } catch (IOException e) {            }        }        return false;    }