Filters files using the supplied wildcards.
This filter selects files, but not directories, based on one or more wildcards
and using case-sensitive comparison.
The wildcard matcher uses the characters '?' and '*' to represent a
single or multiple wildcard characters.
This is the same as often found on Dos/Unix command lines.
The extension check is case-sensitive.
See
FilenameUtils.wildcardMatch for more information.
For example:
File dir = new File(".");
FileFilter fileFilter = new WildcardFilter("*test*.java~*~");
File[] files = dir.listFiles(fileFilter);
for (int i = 0; i < files.length; i++) {
System.out.println(files[i]);
}
author: Jason Anderson version: $Revision: 437680 $ $Date: 2006-08-28 13:57:00 +0200 (Mo, 28 Aug 2006) $ since: Commons IO 1.1 |