public static List<File> findFiles(final File dir, final String filenameToSearch)
	{
		final List<File> foundedFileList = new ArrayList<>();
		final String regex = RegExExtensions.replaceWildcardsWithRE(filenameToSearch);
		final String[] children = dir.list();
		for (final String filename : children)
		{
			if (filename.matches(regex))
			{
				final File foundedFile = new File(filename);
				foundedFileList.add(foundedFile);
			}
		}
		return foundedFileList;
	}
public static List < File > findFiles ( final File dir , final String filenameToSearch ) { final List < File > foundedFileList = new ArrayList < > ( ) ; final String regex = RegExExtensions . replaceWildcardsWithRE ( filenameToSearch ) ; final String [ ] children = dir . list ( ) ; for ( final String filename : children ) { if ( filename . matches ( regex ) ) { final File foundedFile = new File ( filename ) ; foundedFileList . add ( foundedFile ) ; } } return foundedFileList ; }
Finds all files that match the search pattern. The search is not recursively.

@param dir
The directory to search.
@param filenameToSearch
The search pattern. Allowed wildcards are "*" and "?".
@return A List with all files that matches the search pattern.