[jcifs] browsing a smaller network using netserverenum2

Michael B Allen mba2000 at ioplex.com
Fri Feb 4 21:49:20 GMT 2005


On Fri, 4 Feb 2005 13:38:01 -0600
"Christopher R. Hertel" <crh at ubiqx.mn.org> wrote:

> On Fri, Jan 28, 2005 at 04:09:30PM -0500, Michael B Allen wrote:
> > On Fri, 28 Jan 2005 11:02:51 -0600
> > Rana Basheer <ranabasheer at gmail.com> wrote:
> > 
> > > did not find any( I issued a wins name request broadcast ). Please let
> > > me know how I can browse for machines in a small network like mine
> > 
> > You should be able to. If you run examples/ListFiles like:
> > 
> > java -cp jcifs.jar:... ListFiles smb://
> > 
> > what happends?
> 
> Okay...  I'm confused here.  How do I get ListFiles to work with anonymous
> 
> credentials?

I think the smb:// URL is treated a little special. I think it tries the
supplied creds but then falls back to anonymous. If you want to explicitly
specify anonymous I think there is an NPA for that that can be passed to
the SmbFile constructor. You might also be able to do smb://@server/path/,
or perhaps smb://;@server/path/, or maybe smb://:@server/path/. Try
different permutations or look at the code to see how anonymous
credentials are repesented (I think it's an empty string).

Mike

-- 
IRC - where men are men, women are men, and the boys are FBI agents.


More information about the jcifs mailing list