[jcifs] getType question

andrea.lanza at frameweb.it andrea.lanza at frameweb.it
Tue Dec 17 20:24:45 EST 2002








>
>> Hi again, I am happy to have raisen the question about Tomcat class Path
>> and I am very much more happy to have solved that with your help !
>> Now a dramatically easier question:
>> Why if I try to use the smbfile getType() method I am not able to get
the
>> Printer Type ? I have a printer shared on my network, his name (her name
?
>> is a printer female? boh!) is HPLJ3D. I see it shared and if I check the
>> Type it is NOT PRINTER , but FILESYSTEM.
>> Let's say I get a smbFile to smb://myserver/HPLJ3D, and then use getType
()
>> method on that smbFile.
>> Is it correct ? And if it is correct, how can I detect if it is a
printer ?
>>
 >No that is not correct. There was recently an issue with getType()
 returning
 >incorrect values but I thought I resolved it in 0.7.0b9. Which
 >version of jCIFS are you using?

 OK I was using jcifs jcifs_0.7.0b7.
 I downloaded and installed  jcifs_0.7.0b10 and the problem now is solved,
 I see pinter-Type shares correctly.

 Thanks for this.

>> Another question: is it a way to check if I have the rigth to read a
file,
>> or do I have to check for the SMBException after trying to read it ?
>>
 >The canRead() method will return a value based on the file's attributes.
 If the file
 >is locked by another process the canRead method will not consider that in
 which
 >case when trying to read it will result in an SmbException of "The file
 is being
 >accessed by another process".

 I tried to use the canRead() method with no result.

 more specifically, i would like to do this:
 When I browse a network computer, using my credential, and this computer
 is part of my domain, I see its shares (IPC$ C$ d$ and so on)

 But it is very reasonable that I cannot access a lot of them, becouse I am
 not listed in the ACL (FileSystem ACL Level) with the read (or list)
 rigth.
 So it could be fine for me to put a "symbol" near to this share listed,
 meaning no access to this.
 If I try to access this I get the rigth exception (
 jcifs.smb.SmbAuthException: Access denied)
SO: do I have to use this way (specific exception trapping ?)


>> thanks in advance,
>> Andrea
>>
>>


new question !!
since I installed last version I see a lot of
sem.count=2,q1x.ans=null,q20.ans=null
sem.count=1,q1x.ans=null,q20.ans=null
sem.count=2,q1x.ans=null,q20.ans=null
sem.count=1,q1x.ans=null,q20.ans=null

in my stdout file
I think it could be some debugging information "forgotten" here. Is it
correct ?
I think they are generated from the listFiles() method (not sure)

Andrea






More information about the jcifs mailing list