[jcifs] Reset pre-authentication?

Marko Mocnik marko.mocnik at exthex.com
Tue Feb 1 03:56:06 MST 2011


Hello,

I'm using jcifs in an application to read files on Windows shares.
I had to use pre-authentication because without it I got occasional
SmbAuthExceptions.
My code looks something like this:
        System.setProperty("jcifs.smb.client.domain", domain);
        System.setProperty("jcifs.smb.client.username", user);
        System.setProperty("jcifs.smb.client.password", pw);
        SmbFile smbFile = new SmbFile("smb://server/share/");
        .....

which works okay.
But sometimes I have to switch user credentials to access other shares.
Just setting the system properties again does not work since they seem to be
cached somewhere.

So how do I reset the pre-authentication credentials?

Is there another way to use pre-authentication without using system
properties?

Thanks in advance, bye,
Marko


-- 
exthex GmbH - explore the excellence
Marko Mocnik
Software Engineer

Göstinger Straße 213
A-8051 Graz
phone: +43 316 269 898-0
mobile:+43 676 898 464 100
fax:   +43 316 269 898 269
http://www.exthex.com
- - - - - - - - - - - - - - -

be e-nnovative, be excellent!

- - - - - - - - - - - - - - -
The informations in this message serve only for purposes of information,
must be kept strictly confidential and are intended solely for the
addressee. The sender does not make any legally binding statements via
e-mail. If the recipient of this message is not the addressee, one of his
employees or his authorized representative, he gets hereby notified that the
content of the message may not be used, forwarded or reproduced. If you have
received this message erroneously, please notify the sender immediately and
delete the message from your system!
- - - - - - - - - - - - - -
Die Informationen in dieser Nachricht dienen ausschließlich
Informationszwecken, sind vertraulich und ausschließlich für den Adressaten
bestimmt. Der Absender äußert keine rechtsgeschäftlichen Erklärungen via
E-Mail. Der Empfänger dieser Nachricht, der nicht der Adressat, einer seiner
Mitarbeiter oder sein Empfangsbevollmächtigter ist, wird hiermit davon in
Kenntnis gesetzt, dass er deren Inhalt nicht verwenden, weitergeben oder
reproduzieren darf. Sollten sie diese Nachricht irrtümlicherweise erhalten
haben, benachrichtigen sie bitte den Absender  unverzüglich und löschen sie
die Nachricht von Ihrem System!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.samba.org/pipermail/jcifs/attachments/20110201/4202424f/attachment.html>


More information about the jCIFS mailing list