Examples of TokenizedPath


Examples of org.apache.tools.ant.types.selectors.TokenizedPath

        ds.setBasedir(new File("."));
        ds.setIncludes(new String[] {"**"});
        ds.addDefaultExcludes();
        ds.ensureNonPatternSetsReady();
        File f = new File(".svn");
        TokenizedPath p = new TokenizedPath(f.getAbsolutePath());
        assertTrue(ds.contentsExcluded(p));
    }
View Full Code Here

Examples of org.apache.tools.ant.types.selectors.TokenizedPath

                }
            }
            // only scan directories that can include matched files or
            // directories
            for (Map.Entry<TokenizedPath, String> entry : newroots.entrySet()) {
                TokenizedPath currentPath = entry.getKey();
                String currentelement = currentPath.toString();
                if (basedir == null
                    && !FileUtils.isAbsolutePath(currentelement)) {
                    continue;
                }
                File myfile = new File(basedir, currentelement);

                if (myfile.exists()) {
                    // may be on a case insensitive file system.  We want
                    // the results to show what's really on the disk, so
                    // we need to double check.
                    try {
                        String path = (basedir == null)
                            ? myfile.getCanonicalPath()
                            : FILE_UTILS.removeLeadingPath(canonBase,
                                         myfile.getCanonicalFile());
                        if (!path.equals(currentelement) || ON_VMS) {
                            myfile = currentPath.findFile(basedir, true);
                            if (myfile != null && basedir != null) {
                                currentelement = FILE_UTILS.removeLeadingPath(
                                    basedir, myfile);
                                if (!currentPath.toString()
                                    .equals(currentelement)) {
                                    currentPath =
                                        new TokenizedPath(currentelement);
                                }
                            }
                        }
                    } catch (IOException ex) {
                        throw new BuildException(ex);
                    }
                }

                if ((myfile == null || !myfile.exists()) && !isCaseSensitive()) {
                    File f = currentPath.findFile(basedir, false);
                    if (f != null && f.exists()) {
                        // adapt currentelement to the case we've
                        // actually found
                        currentelement = (basedir == null)
                            ? f.getAbsolutePath()
                            : FILE_UTILS.removeLeadingPath(basedir, f);
                        myfile = f;
                        currentPath = new TokenizedPath(currentelement);
                    }
                }

                if (myfile != null && myfile.exists()) {
                    if (!followSymlinks && currentPath.isSymlink(basedir)) {
                        accountForNotFollowedSymlink(currentPath, myfile);
                        continue;
                    }
                    if (myfile.isDirectory()) {
                        if (isIncluded(currentPath)
View Full Code Here

Examples of org.apache.tools.ant.types.selectors.TokenizedPath

        }
    }

    private void processSlowScan(String[] arr) {
        for (int i = 0; i < arr.length; i++) {
            TokenizedPath path  = new TokenizedPath(arr[i]);
            if (!couldHoldIncluded(path) || contentsExcluded(path)) {
                scandir(new File(basedir, arr[i]), path, false);
            }
        }
    }
View Full Code Here

Examples of org.apache.tools.ant.types.selectors.TokenizedPath

     * @see #dirsNotIncluded
     * @see #dirsExcluded
     * @see #slowScan
     */
    protected void scandir(File dir, String vpath, boolean fast) {
        scandir(dir, new TokenizedPath(vpath), fast);
    }
View Full Code Here

Examples of org.apache.tools.ant.types.selectors.TokenizedPath

            directoryNamesFollowed.addFirst(dir.getName());
        }

        for (int i = 0; i < newfiles.length; i++) {
            String name = vpath + newfiles[i];
            TokenizedPath newPath = new TokenizedPath(path, newfiles[i]);
            File file = new File(dir, newfiles[i]);
            String[] children = file.list();
            if (children == null || (children.length == 0 && file.isFile())) {
                if (isIncluded(newPath)) {
                    accountForIncludedFile(newPath, file);
View Full Code Here

Examples of org.apache.tools.ant.types.selectors.TokenizedPath

            scandir(file, name, fast, children, directoryNamesFollowed);
        }
    }

    private void accountForNotFollowedSymlink(String name, File file) {
        accountForNotFollowedSymlink(new TokenizedPath(name), file);
    }
View Full Code Here

Examples of org.apache.tools.ant.types.selectors.TokenizedPath

     * @param name The name to match. Must not be <code>null</code>.
     * @return <code>true</code> when the name matches against at least one
     *         include pattern, or <code>false</code> otherwise.
     */
    protected boolean isIncluded(String name) {
        return isIncluded(new TokenizedPath(name));
    }
View Full Code Here

Examples of org.apache.tools.ant.types.selectors.TokenizedPath

     * @param name The name to match. Must not be <code>null</code>.
     * @return <code>true</code> when the name matches against the start of at
     *         least one include pattern, or <code>false</code> otherwise.
     */
    protected boolean couldHoldIncluded(String name) {
        return couldHoldIncluded(new TokenizedPath(name));
    }
View Full Code Here

Examples of org.apache.tools.ant.types.selectors.TokenizedPath

     * @param name The name to match. Must not be <code>null</code>.
     * @return <code>true</code> when the name matches against at least one
     *         exclude pattern, or <code>false</code> otherwise.
     */
    protected boolean isExcluded(String name) {
        return isExcluded(new TokenizedPath(name));
    }
View Full Code Here

Examples of org.apache.tools.ant.types.selectors.TokenizedPath

        ArrayList<TokenizedPattern> al = new ArrayList<TokenizedPattern>(patterns.length);
        for (int i = 0; i < patterns.length; i++) {
            if (!SelectorUtils.hasWildcards(patterns[i])) {
                String s = isCaseSensitive()
                    ? patterns[i] : patterns[i].toUpperCase();
                map.put(s, new TokenizedPath(s));
            } else {
                al.add(new TokenizedPattern(patterns[i]));
            }
        }
        return (TokenizedPattern[]) al.toArray(new TokenizedPattern[al.size()]);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.