Package org.apache.tools.ant

Examples of org.apache.tools.ant.DirectoryScanner.scan()


     * @param theClasspath the classpaths needed to load the test classes
     */
    public void processFileSet(FileSet theFileset, Path theClasspath)
    {
        DirectoryScanner ds = theFileset.getDirectoryScanner(this.project);
        ds.scan();
        String[] files = ds.getIncludedFiles();

        for (int i = 0; i < files.length; i++)
        {
            // The path is supposed to be a relative path that matches the
View Full Code Here


  public void execute() throws BuildException {
    for (int k = 0; k < fileSets.size(); k++) {
      FileSet fileSet = fileSets.get(k);
      DirectoryScanner dirScanner = fileSet.getDirectoryScanner(getProject());
      dirScanner.scan();
      String[] includedFiles = dirScanner.getIncludedFiles();
      for (int i = 0; i < includedFiles.length; i++) {
        String fileS = includedFiles[i];
        LineNumberReader in = null;
        try {
View Full Code Here

    public void testGetWithSelector() {
      buildRule.executeTarget("ftp-get-with-selector");
      assertContains("selectors are not supported in remote filesets", buildRule.getLog());
        FileSet fsDestination = (FileSet) buildRule.getProject().getReference("fileset-destination-without-selector");
        DirectoryScanner dsDestination = fsDestination.getDirectoryScanner(buildRule.getProject());
        dsDestination.scan();
        String [] sortedDestinationDirectories = dsDestination.getIncludedDirectories();
        String [] sortedDestinationFiles = dsDestination.getIncludedFiles();
        for (int counter = 0; counter < sortedDestinationDirectories.length; counter++) {
            sortedDestinationDirectories[counter] =
                sortedDestinationDirectories[counter].replace(File.separatorChar, '/');
View Full Code Here

            sortedDestinationFiles[counter] =
                sortedDestinationFiles[counter].replace(File.separatorChar, '/');
        }
        FileSet fsSource =  (FileSet) buildRule.getProject().getReference("fileset-source-without-selector");
        DirectoryScanner dsSource = fsSource.getDirectoryScanner(buildRule.getProject());
        dsSource.scan();
        compareFiles(dsSource, sortedDestinationFiles, sortedDestinationDirectories);
    }
   
    @Test
    public void testGetFollowSymlinksTrue() {
View Full Code Here

        Assume.assumeTrue(loginFailureMessage, loginSuceeded);
        Assume.assumeTrue("Could not change remote directory", changeRemoteDir(remoteTmpDir));
        buildRule.getProject().executeTarget("ftp-get-directory-symbolic-link");
        FileSet fsDestination = (FileSet) buildRule.getProject().getReference("fileset-destination-without-selector");
        DirectoryScanner dsDestination = fsDestination.getDirectoryScanner(buildRule.getProject());
        dsDestination.scan();
        compareFiles(dsDestination, new String[] {"alpha/beta/gamma/gamma.xml"},
            new String[] {"alpha", "alpha/beta", "alpha/beta/gamma"});
    }
   
    @Test
View Full Code Here

        Assume.assumeTrue(loginFailureMessage, loginSuceeded);
        Assume.assumeTrue("Could not change remote directory", changeRemoteDir(remoteTmpDir));
        buildRule.getProject().executeTarget("ftp-get-directory-no-symbolic-link");
        FileSet fsDestination = (FileSet) buildRule.getProject().getReference("fileset-destination-without-selector");
        DirectoryScanner dsDestination = fsDestination.getDirectoryScanner(buildRule.getProject());
        dsDestination.scan();
        compareFiles(dsDestination, new String[] {},
            new String[] {});
    }
   
    @Test
View Full Code Here

                ds.setErrorOnMissingDir(errorOnMissingDir);
                ds.setMaxLevelsOfSymlinks(maxLevelsOfSymlinks);
                directoryScanner = (p == getProject()) ? ds : directoryScanner;
            }
        }
        ds.scan();
        return ds;
    }

    /**
     * Set up the specified directory scanner against this
View Full Code Here

        ds.setCaseSensitive(false);
        ds.setIncludes(new String[] {
                "**/index.html", "**/index.htm", "**/toc.html", "**/toc.htm"
            });
        ds.addDefaultExcludes();
        ds.scan();
        int patched = 0;
        for (String f : ds.getIncludedFiles()) {
            patched += postProcess(new File(destDir, f), fixData);
        }
        if (patched > 0) {
View Full Code Here

            StringTokenizer token = new StringTokenizer(fileSuffixes, ",");
            while (token.hasMoreTokens())
            {
                DirectoryScanner ds = getDirectoryScanner(getDir());
                ds.setIncludes(new String[]{"**\\*." + token.nextToken()});
                ds.scan();
                for (int i = 0; i < ds.getIncludedFiles().length; i++)
                {
                    createArg().setFile(new File(getDir(), ds.getIncludedFiles()[i]));
                }
            }
View Full Code Here

        final int size = filesets.size();
        for (int i = 0; i < size; i++)
        {
            FileSet fs = (FileSet) filesets.elementAt(i);
            DirectoryScanner ds = fs.getDirectoryScanner(getProject());
            ds.scan();
            String[] f = ds.getIncludedFiles();
            for (int j = 0; j < f.length; j++)
            {
                String pathname = f[j];
                File file = new File(ds.getBasedir(), pathname);
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.