[jcifs] getType question

Allen, Michael B (RSCH) Michael_B_Allen at ml.com
Tue Dec 17 11:01:42 EST 2002


> -----Original Message-----
> From:	andrea.lanza at frameweb.it [SMTP:andrea.lanza at frameweb.it]
> Sent:	Monday, December 16, 2002 4:10 PM
> To:	jcifs at lists.samba.org
> Subject:	[jcifs] getType question
> 
> 
> 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?

> 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".

> thanks in advance,
> Andrea
> 
> 
> 
> 




More information about the jcifs mailing list