Accepts a selection if it is acceptable to both of two {@link FilenameFilter}s.
This takes two {@link FilenameFilter}s as input.
Eg., to print all files beginning with A and ending with .java :
File dir = new File(".");
String[] files = dir.list( new AndFileFilter(
new PrefixFileFilter("A"),
new ExtensionFileFilter(".java")
)
);
for ( int i=0; i<files.length; i++ )
{
System.out.println(files[i]);
}
|