[jcifs] SmbFile.exists( "smb://server" )

Michael B. Allen miallen at eskimo.com
Sun Feb 23 19:23:22 EST 2003

On Sun, 23 Feb 2003 00:36:30 -0600
"Christopher R. Hertel" <crh at ubiqx.mn.org> wrote:

> I was fiddling with the Exists.java tool in the examples directory and 
> noticed that when given a URL with just a server name it sends a name 
> query.  That is:
> $ java Exists smb://server
> sends a broadcast name query for SERVER<20>.
> Now, that is a valid test on a broadcast NBT network.  If a response to
> the broadcast is received it means that there is a node claiming that 
> name.
> Unfortuantely, I don't have my network set up for WINS testing at the 
> moment.  What I want to know is this:  If WINS is in use, does the Exists 
> test query the WINS server and, if so, what does it do afterward?

This is all described pretty well here:


> See, the problem I'm concerned about is that a name may exist in the WINS 
> database even though the machine that registered the name has been shut 
> down.  Good behavior is that a cleanly shut-down system would release the 
> name first, but that doesn't always happen and some WINS implementations 
> are flakey.  So the proper test would be to send an Adapter Status query 
> following the WINS lookup to verify the name.

No, we don't do that. If you look at UniAddress.getByName and consider
the jcifs.netbios.wins and jcifs.resolveOrder property and what they do
the name resolution capability of jCIFS is second to none. It is equally
good at finding a good "called name". If an IP is giving it may do a
node status although only as a last resort. Again see UniAddress.java.


A  program should be written to model the concepts of the task it
performs rather than the physical world or a process because this
maximizes  the  potential  for it to be applied to tasks that are
conceptually  similar and, more important, to tasks that have not
yet been conceived. 

More information about the jcifs mailing list