[jcifs] smbfile.listFiles() for only directories

Michael B Allen mba2000 at ioplex.com
Thu Sep 30 23:07:15 GMT 2004


Michael B Allen said:
>> So am I back to isDirectory() on each of the files returned, or is there
>> any other way I can ask for it that would either move the processing to
>> the server, or during list creation?
>
> Extend DosFileFilter and overload accept with:
>
>     boolean accept(SmbFile file) {
>         return (file.getAttributes() & attributes) != 0;
>     }
>
> and use the said technique with your new filter.
>
> Knowing that servers may ignore some file attributes I will incorporate
> this change into DosFileFilter to assert the desired files are returned.

This change has been incorporated into 1.1 TBR shortly.

Thanks for your report,
Mike


More information about the jcifs mailing list