[jcifs] smbfile.listFiles() for only directories

MacDermid, Kenny kenny.macdermid at abridean.com
Tue Sep 14 14:28:26 GMT 2004


Hello,

I'm looking for a way to have jcifs only list directories on a =
listFiles(). I was hoping that there might be a way to do this in the =
request passed across the network, to prevent having to filter them when =
they return (I don't know if this is supported in cifs or not).

I will be browsing a directory system that may have 1000's of files at =
each directory level and it seems like calling isDirectory() on each =
would be quite a slowdown.

Looking at:

public SmbFile[] listFiles( )

I see it calls:

listFiles( wildcard, ATTR_DIRECTORY | ATTR_HIDDEN | ATTR_SYSTEM, null, =
null)

Which is package protected. So my first thought was that I could add a =
method that would call it with only ATTR_DIRECTORY, or change it to =
public.

Can you recommend any other way to do this? It appears this value is =
passed across the wire, so will the other side do the filtering? I would =
rather not have to build a custom library in our build, so is there =
anyway to do this with the current library?

Thanks in advance,

Kenny

--=20
Outgoing mail is certified Virus Contaminated:
X5O!P%@AP[4(P^)7CC)7$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*
Checked by AVG Anti-Virus (http://www.grisoft.com).
Version: 7.0.270 / Virus Database: 264.9.0 - Release Date: 13/09/2004
=20


More information about the jcifs mailing list