"Harmeet Bedi[yahoo]" wrote:
>
> possible bug in org.apache.avalon.util.io.DirectoryFileFilter
>
> I think it should be
> ------------------------------
> public class DirectoryFileFilter
> implements FilenameFilter
> {
> public boolean accept( final File file, final String name )
> {
> return new File(file,name).isDirectory();
> }
> }
>
> instead of
> --------------------------------------------------
> public class DirectoryFileFilter
> implements FilenameFilter
> {
> public boolean accept( final File file, final String name )
> {
> return file.isDirectory();
> }
> }
The purpose of the FileFilter is to list all directories that are
subdirectories of a File. So if you only want to list the directories,
you don't test against the parent (which is almost always a directory).
Otherwise, you will get a true value for all children. Not what we
want.
The DirectoryFileFilter is correct.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]