Contains a default list of {@link Path}s with directories/files that contains files having regexes of file names to be ignored.
14048
public List<Path> getDefaultUserIgnoreDirectories()
    {
        List<Path> paths = getOptionValue(DEFAULT_USER_IGNORE_DIRECTORIES_OPTION);
        if (paths == null)
        {
            return Collections.emptyList();
        }
        return Collections.unmodifiableList(paths);
    }
463312
static Collection<Path> findFiles(Path dir) {
		return toPaths(dir.toFile().listFiles((FileFilter) FileFileFilter.FILE));
	}
548884
public static File[] getFilesListByExtention( String folderPath, final String ext ) {
        File[] files = new File(folderPath).listFiles(new FilenameFilter(){
            public boolean accept( File dir, String name ) {
                return name.endsWith(ext);
            }
        });
        return files;
    }
411534
private Set<String> initExcludedPathList(Set<String> paths) {
		Set<String> toExclude = new HashSet<>();
		if (null == paths)
			return toExclude;

		for (String path : paths) {
			path = PathNormalizer.asPath(path);
			toExclude.add(path);
		}
		return toExclude;
	}
1156379
def find_files(self, root):
        

        def is_ignored(path, ignore_patterns):
            """
            Check if the given path should be ignored or not.
            """
            filename = os.path.basename(path)
            ignore = lambda pattern: fnmatch.fnmatchcase(filename, pattern)
            return any(ignore(pattern) for pattern in ignore_patterns)

        dir_suffix = '%s*' % os.sep
        normalized_patterns = [
            p[:-len(dir_suffix)] if p.endswith(dir_suffix) else p
            for p in self.ignore_patterns
        ]

        all_files = []
        walker = os.walk(root, topdown=True, followlinks=self.follow_symlinks)
        for dir_path, dir_names, file_names in walker:
            for dir_name in dir_names[:]:
                path = os.path.normpath(os.path.join(dir_path, dir_name))
                if is_ignored(path, normalized_patterns):
                    dir_names.remove(dir_name)
                    if self.verbose:
                        print_out("Ignoring directory '{:}'".format(dir_name))
            for file_name in file_names:
                path = os.path.normpath(os.path.join(dir_path, file_name))
                if is_ignored(path, self.ignore_patterns):
                    if self.verbose:
                        print_out("Ignoring file '{:}' in '{:}'".format(
                                  file_name, dir_path))
                else:
                    all_files.append((dir_path, file_name))
        return sorted(all_files)
1341687
boolean matches(final String path) {

        logger.debug("path to match: {}", path);

        if (excludedPaths.contains(path)) {
            return false;
        }

        for (Pattern pattern : excludedPatterns) {
            if (pattern.matcher(path).matches()) {
                return false;
            }
        }

        return true;
    }
1342136
private Set<String> findExclusionPaths(ServletContext servletContext) {
        Set<String> exclusions = new TreeSet<String>();
        
        // Let other handlers deal with folders that do not reside in the WEB-INF or META-INF
        Set<String> resourcePaths = servletContext.getResourcePaths("/");
        
        // This most certainly should not be null!
        // It means that the server cannot read files at all
        if (resourcePaths == null) throw new InitException("ServletContext cannot read files. Reason is unknown");
        
        resourcePaths.removeIf( path -> path.contains("-INF") || path.contains("-inf"));
    
        // We still need to also remove the views folder from being processed by other handlers
        resourcePaths.removeIf( path -> path.contains(TemplateEngine.TEMPLATES_FOLDER));
        
        // Add the remaining paths to exclusions
        for (String path : resourcePaths) {
            // add leading slash
            if (path.charAt(0) != '/')
                path = '/' + path;
            
            // remove the last slash
            if (path.charAt(path.length()-1) == '/')
                path = path.substring(0, path.length()-1);
            exclusions.add(path);
        }
        
        return exclusions;
    }
1094111
private static File[] getAllFiles(String dirName, String regex) {

    File[] allFiles = getAllFiles(dirName);

    List<File> matchingFiles = new ArrayList<File>();

    for (File allFile : allFiles) {

      if (allFile.getName().matches(regex)) {
        matchingFiles.add(allFile);
      }
    }

    return matchingFiles.toArray(new File[matchingFiles.size()]);
  }
591706
function files(path, ...matchers) {
	if ( matchers.length ) {
		return listFiles(path.replace(/\\/g, '/'), matchers);
	}

	let rs = [];
	if( isDirectoryExists(path) ) {
		let ls = fs.readdirSync(path);
		ls.forEach((file, index) => rs.push(path + "/" + file));
	}
	return rs;
}
1371424
public File[] listFiles(String directoryPath) {
        File[] result = null;
        File directory = null;
        directory = new File(directoryPath);
        if (directory.isDirectory()) {
            result = directory.listFiles();
        }
        return result;
    }
484811
function getFileNames(path, extension)
{
    var docPath = __dirname + '/' + path;
    var fileNames = [];
    var findPattern = new RegExp("." + extension + "$");
    var replacePattern = new RegExp("." + extension + "$","g");
    fs.readdirSync( docPath ).forEach( function(fileName ) {
        if( fileName.match( findPattern ) ) {
            fileNames.push( fileName.replace( replacePattern, "" ) );
        }
    });

    verbose && console.log('Read "' + extension + '" files from ' + docPath );

    return fileNames;
}
634323
public static File[] listFiles(final String ext) {
		init();
		
		return config.listFiles(new FilenameFilter() {

			public boolean accept(File dir, String name) {
				return name.endsWith(ext);
			}
		});
	}
894517
def ignore_path(path):
        
        ignore = False
        for name in ['.tox', 'dist', 'build', 'node_modules', 'htmlcov']:
            if path.find(name) >= 0:
                ignore = True
                break
        return ignore
849119
def filter_files(self, path):
        
        excludes = r'|'.join([fnmatch.translate(x) for x in self.project.EXCLUDES]) or r'$.'
        for root, dirs, files in os.walk(path, topdown=True):
            dirs[:] = [d for d in dirs if not re.match(excludes, d)]
            dirs[:] = [os.path.join(root, d) for d in dirs]
            rel_path = os.path.relpath(root, path)

            paths = []
            for f in files:
                if rel_path == '.':
                    file_path = f
                else:
                    file_path = os.path.join(rel_path, f)
                if not re.match(excludes, file_path):
                    paths.append(f)

            files[:] = paths
            yield root, dirs, files
691666
public static Collection<String> listFiles(String filesString, String delimiter) {
    ValidationUtils.validateNotEmpty(filesString, "fileStr");

    List<String> files = new ArrayList<String>();
    for (String fileString : filesString.split(delimiter)) {
      File file = new File(fileString);
      if (!file.getName().contains("*") && !file.getName().contains("?")) {
        files.add(file.getAbsolutePath());
        continue;
      }

      FileFilter fileFilter = new AndFileFilter(new WildcardFileFilter(file.getName()),
          FileFileFilter.FILE);
      File parent = file.getParentFile() == null ? file : file.getParentFile();
      File[] filteredFiles = parent.listFiles(fileFilter);
      if (filteredFiles == null) {
        continue;
      }

      for (File filteredFile : filteredFiles) {
        files.add(filteredFile.getAbsolutePath());
      }
    }
    return files;
  }
185575
private Set<String> findExclusionPaths() throws InitException {
       Set<String> exclusions = new TreeSet<String>();
       
       // Let other handlers deal with folders that do not reside in the WEB-INF or META-INF
       List<String> collect = null;
       File webapp = new File(deploymentInfo.getRealPath(""));
       String[] paths = webapp.list();
       if (webapp.exists() && paths != null)
           collect = Arrays.asList(paths);
       
       if (webapp.exists() && !webapp.canRead()) {
           // It means that the server cannot read files at all
           throw new InitException( HttpHandlerImpl.class.getName() + " cannot read files. Reason is unknown");
       } else if (!webapp.exists() || collect == null || collect.isEmpty()) {
           // Whenever this is empty it might just be because someone forgot to add the 'webapp' folder to the distribution
           // OR the framework is used without the need for serving files (such as views).
           logger.error("HttpHandlerImpl did not find any files in webapp - not serving any files then");
           return exclusions;
       }
       
       Set<String> resourcePaths = new TreeSet<>(collect);//servletContext.getResourcePaths("/");
       resourcePaths.removeIf( path -> path.contains("-INF") || path.contains("-inf"));
   
       // We still need to also remove the views folder from being processed by other handlers
       resourcePaths.removeIf( path -> path.contains(TemplateEngine.TEMPLATES_FOLDER));
       
       // Add the remaining paths to exclusions
       for (String path : resourcePaths) {
           // add leading slash
           if (path.charAt(0) != '/')
               path = '/' + path;
           
           // remove the last slash
           if (path.charAt(path.length()-1) == '/')
               path = path.substring(0, path.length()-1);
           exclusions.add(path);
       }
       
       return exclusions;
   }
573252
public static boolean isExcluded(String filename, List<String> excludes) {
        logger.debug("filename = [{}], excludes = [{}]", filename, excludes);

        // No rules ? Fine, we index everything
        if (excludes == null || excludes.isEmpty()) {
            logger.trace("no rules");
            return false;
        }

        // Exclude rules : we know that whatever includes rules are, we should exclude matching files
        for (String exclude : excludes) {
            String regex = exclude.toLowerCase().replace("?", ".?").replace("*", ".*?");
            logger.trace("regex is [{}]", regex);
            if (filename.toLowerCase().matches(regex)) {
                logger.trace("does match exclude regex");
                return true;
            }
        }

        logger.trace("does not match any exclude pattern");
        return false;
    }