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 {@link 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]);
}
|