[jcifs] authentication

Michael B Allen mba2000 at ioplex.com
Thu Jul 13 16:02:50 GMT 2006


On Thu, 13 Jul 2006 12:16:06 +0200
"Torsten Curdt" <tcurdt at vafer.org> wrote:

> > Just do:
> >
> > SmbFile f = new SmbFile("smb://server/ipc$", new NtlmPasswordAuthentication(null, "user", "pass"));
> 
> ...but I also will have to check f.canRead() to see whether I can get
> acces, right?

Actually no. The canRead() method only checks to see if the Read-Only
attribute is set. The user may be blocked from accessing the file due to
an ACL entry (or lack thereof). The best method is to put the operation
into a try catch and do what you would do if you cannot read in the catch.

Mike

-- 
Michael B Allen
PHP Extension for SSO w/ Windows Group Authorization
http://www.ioplex.com/


More information about the jcifs mailing list