Esempio n. 1
0
  private DirectoryScanner scan(FileSet fileSet) {
    File basedir = new File(fileSet.getDirectory());

    if (!basedir.exists() || !basedir.isDirectory()) {
      return null;
    }

    DirectoryScanner scanner = new DirectoryScanner();

    List<String> includesList = fileSet.getIncludes();
    List<String> excludesList = fileSet.getExcludes();

    if (includesList.size() > 0) {
      scanner.setIncludes(includesList.toArray(new String[0]));
    }

    if (excludesList.size() > 0) {
      scanner.setExcludes(excludesList.toArray(new String[0]));
    }

    if (true) // fileSet.isUseDefaultExcludes() )
    {
      scanner.addDefaultExcludes();
    }

    scanner.setBasedir(basedir);
    scanner.setFollowSymlinks(true); // fileSet.isFollowSymlinks() );

    scanner.scan();

    return scanner;
  }
Esempio n. 2
0
 private synchronized void ensureDirectoryScannerSetup() {
   dieOnCircularReference();
   if (ds == null) {
     ds = new DirectoryScanner();
     PatternSet ps = mergePatterns(getProject());
     ds.setIncludes(ps.getIncludePatterns(getProject()));
     ds.setExcludes(ps.getExcludePatterns(getProject()));
     ds.setSelectors(getSelectors(getProject()));
     if (useDefaultExcludes) {
       ds.addDefaultExcludes();
     }
     ds.setCaseSensitive(caseSensitive);
     ds.setFollowSymlinks(followSymlinks);
   }
 }