/** * Do we have to traverse a symlink when trying to reach path from * basedir? * @param base base File (dir). * @param path file path. * @since Ant 1.6 */ private boolean isSymlink(File base, String path) { return isSymlink(base, SelectorUtils.tokenizePath(path)); }
/** * Do we have to traverse a symlink when trying to reach path from * basedir? * @param base base File (dir). * @param pathElements Vector of path elements (dirs...file). * @since Ant 1.6 */ private boolean isSymlink(File base, Vector pathElements) { if (pathElements.size() > 0) { String current = (String) pathElements.remove(0); try { return FileUtil.isSymbolicLink(base, current) || isSymlink(new File(base, current), pathElements); } catch (IOException ioe) { String msg = "IOException caught while checking " + "for links, couldn't get canonical path!"; // will be caught and redirected to Ant's logging system System.err.println(msg); } } return false; }
&& isSymlink(basedir, currentelement)) { continue;