[jcifs] New user questions
Allen, Michael B (RSCH)
Michael_B_Allen at ml.com
Thu Mar 14 13:26:18 EST 2002
> -----Original Message-----
> From: Tony Thompson [SMTP:tony.thompson at stone-ware.com]
> Sent: Wednesday, March 13, 2002 5:40 PM
> To: jcifs at lists.samba.org
> Subject: [jcifs] New user questions
> I am attempting to run the example SmbShell provided with the distribution and just about anything I have tried results in an UnknownHostException. The FAQ talks about this exception but, I don't
> know how to specify the host when I am using SmbShell. Any pointers?
If you can't even start it then you don't have a master browser which is admittedly a
problem but the SmbShell is just a demo. Otherwise just type the name:
smb://> cd myservername
Otherwise look closer at the FAQ.
> The other issue that I have is the way SmbFile works. It appears that I can only have one SmbFile instance hanging around in a JVM because of the way authentication is handled (it uses a static
> AuthHandler). I need to be able to create several connections to a CIFS server with potentially different users authenticated on each connection all within the same JVM instance. Is there a way to
> do this?
Just do it. Look at how athentication is passed in the URL and take appropriate
action based on what username is passed to your AuthHandler. You also do not
need to use AuthHandler at all. In fact you probably don't for backend type work.
> Once I have a connection, I will be performing several operations via the same connection (don't authenticate each time) and then disconnecting the connection. Is there a way to keep a session
> connected and then disconnect it when I am done? I couldn't find a way to disconnect a session.
The public interface to jCIFS does not provide the concept of a "connection". That is
not necessary. The client will multiplex IO in an optimal way.
More information about the jcifs