[jcifs] Hosts and shares enumeration

Alexander Buloichik Alexander_Buloichik at epam.com
Tue Jun 29 08:48:27 GMT 2004


Hi, All !

I see one small issue in jcifs(version 0.9.3).

SmbFile doesn't inherit auth information on the listFiles method.

So, when I run 
        auth = new NtlmPasswordAuthentication(domain, username, password);
        workgroup = new SmbFile("smb://myworkgroupname/", auth); 
        SmbFile[] hosts = workgroup.listFiles();
It returns list of all hosts in workgroup. 

Next, I'm tring to retrieve shares list from hosts:
       SmbFile[] shares = host[0].listFiles();
And I see SmbAuthException(Access is denied).

When I try this code:
       SmbFile hostToList = new SmbFile(workgroup, host[0].getName, auth);
       SmbFile[] shares = host[0].listFiles();
It works fine.

Also, when I enumerate share, then I can't enumerate directories, because I 
see SmbAuthException.


WBR, Alex.


More information about the jcifs mailing list