Package org.apache.tools.ant

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


        Project project = task.getProject();
        for (Iterator i = config.supportFileSets.iterator(); i.hasNext();) {
            FileSet supportFileSet = (FileSet) i.next();
            File supportBaseDir = supportFileSet.getDir(project);
            DirectoryScanner supportScanner = supportFileSet.getDirectoryScanner(project);
            supportScanner.scan();
            String[] supportFiles = supportScanner.getIncludedFiles();
            for (int j = 0; j < supportFiles.length; ++j) {
                ejbFiles.put(supportFiles[j], new File(supportBaseDir, supportFiles[j]));
            }
        }
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

            saxParserFactory.setValidating(true);
            SAXParser saxParser = saxParserFactory.newSAXParser();


            DirectoryScanner ds = getDirectoryScanner(config.descriptorDir);
            ds.scan();
            String[] files = ds.getIncludedFiles();

            log(files.length + " deployment descriptors located.",
                Project.MSG_VERBOSE);
View Full Code Here

        }
        DirectoryScanner ds = new DirectoryScanner();
        ds.setIncludes(new String [] {"**_?*.class"});
        ds.setBasedir(srcdir);
        ds.setCaseSensitive(true);
        ds.scan();
        String[] files = ds.getIncludedFiles();
        int count = 0;
        for (int i = 0; i < files.length; i++) {
            RegexpMatcher rm = loadRegexpMatcher();
            rm.setPattern("(.*)_(\\d*).class");
 
View Full Code Here

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

        String[] dsfiles = null;
        if (task.getAction() == FTPTask.RM_DIR) {
            dsfiles = ds.getIncludedDirectories();
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

            throw new BuildException(dir.getAbsolutePath()+" is not a directory.");
        }

        DirectoryScanner ds = new DirectoryScanner();
        setupDirectoryScanner(ds, p);
        ds.scan();
        return ds;
    }
   
    public void setupDirectoryScanner(FileScanner ds, Project p) {
        if (ds == null) {
View Full Code Here

        log("Scanning for files with suffixes: " + fileSuffixes, Project.MSG_VERBOSE);
        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]));
          }
        }
      } else {
View Full Code Here

    Vector<File> v = new Vector<File>();
    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);
        file = getProject().resolveFile(file.getPath());
View Full Code Here

      directoryScanner.setBasedir(new File(basedir));
    }
    directoryScanner.setIncludes(stringListToArray(includes));
    directoryScanner.setExcludes(stringListToArray(excludes));

    directoryScanner.scan();
    return Arrays.asList(directoryScanner.getIncludedFiles());
  }

  private String[] stringListToArray(List<String> stringList) {
    if (stringList == null) {
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.