Package org.apache.tools.ant

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


  private File[] getFiles(FileSet[] pFileSets) {
    List list = new ArrayList();
    for (int i = 0;  i < pFileSets.length;  i++) {
      FileSet fileSet = pFileSets[i];
      DirectoryScanner scanner = fileSet.getDirectoryScanner(getProject());
      scanner.scan();
      String[] files = scanner.getIncludedFiles();
      for (int j = 0;  j < files.length;  j++) {
        list.add(new File(fileSet.getDir(getProject()), files[j]));
      }
    }
View Full Code Here


            Project.MSG_VERBOSE);
        result = false;
        continue;
      }
      DirectoryScanner scanner = myProduces[i].getDirectoryScanner(getProject());
      scanner.scan();
      String[] files = scanner.getIncludedFiles();
      if (files.length == 0) {
        log("The fileset specified by the nested 'produces' element #" + i + " is empty, up-to-date check returns false",
            Project.MSG_VERBOSE);
        result = false;
View Full Code Here

        Vector v = new Vector();
        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];
                if (pathname.endsWith(".xml")) {
                    File file = new File(ds.getBasedir(), pathname);
View Full Code Here

        MockControl fsCtrl = MockClassControl.createControl(FileSet.class);
        FileSet fileset = (FileSet)fsCtrl.getMock();
        fileset.getDirectoryScanner(null);
        fsCtrl.setDefaultMatcher(MockClassControl.ALWAYS_MATCHER);
        fsCtrl.setReturnValue(scanner);
        scanner.scan();
        scanner.getIncludedFiles();
        dsCtrl.setReturnValue(new String[]{"foo.xml", "bar", "spam.xml", "eggs"});
        scanner.getBasedir();
        dsCtrl.setReturnValue(tempDir, 2);
View Full Code Here

        MockControl fsCtrl = MockClassControl.createControl(FileSet.class);
        FileSet fileset = (FileSet)fsCtrl.getMock();
        fileset.getDirectoryScanner(null);
        fsCtrl.setDefaultMatcher(MockClassControl.ALWAYS_MATCHER);
        fsCtrl.setReturnValue(scanner);
        scanner.scan();
        scanner.getIncludedFiles();
        dsCtrl.setReturnValue(new String[]{"foo.xml", "bar", "spam.xml", "eggs"});
        scanner.getBasedir();
        dsCtrl.setReturnValue(new File("."), 2);
View Full Code Here

        MockControl fsCtrl = MockClassControl.createControl(FileSet.class);
        FileSet fileset = (FileSet)fsCtrl.getMock();
        fileset.getDirectoryScanner(null);
        fsCtrl.setDefaultMatcher(MockClassControl.ALWAYS_MATCHER);
        fsCtrl.setReturnValue(scanner);
        scanner.scan();
        scanner.getIncludedFiles();
        dsCtrl.setReturnValue(new String[]{"foo.xml", "bar", "spam.xml", "eggs"});
        scanner.getBasedir();
        dsCtrl.setReturnValue(new File("."), 2);
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];
        if (pathname.endsWith(".xml"))
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];
        if (pathname.endsWith(".xml"))
View Full Code Here

            ds = fs.getDirectoryScanner(getProject());
        } else {
            ds = new FTPDirectoryScanner(ftp);
            fs.setupDirectoryScanner(ds, getProject());
            ds.setFollowSymlinks(fs.isFollowSymlinks());
            ds.scan();
        }

        String[] dsfiles = null;
        if (action == RM_DIR) {
            dsfiles = ds.getIncludedDirectories();
View Full Code Here

        DirectoryScanner directoryScanner = new DirectoryScanner();
        directoryScanner.setBasedir( directory );
        directoryScanner.setIncludes( includePatterns );
        directoryScanner.setExcludes( excludePatterns );
        directoryScanner.scan();
        String[] files = directoryScanner.getIncludedFiles();

        for ( int i = 0; i < files.length; i++ )
        {
            files[i] = new File( directory, files[i] ).getAbsolutePath();
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.