[jcifs] canRead always returning false
Allen, Michael B (RSCH)
Michael_B_Allen at ml.com
Thu Dec 13 14:35:08 EST 2001
> -----Original Message-----
> From: Rob Wygand [SMTP:rob at filefish.com]
> Sent: Wednesday, December 12, 2001 7:46 PM
> To: jcifs at samba.org
> Subject: [jcifs] canRead always returning false
> Found something new today. It looks like SmbFile.canRead() is always
> returning false.
False? That's very strange. From looking at the code I don't see how it's possible. It should return true if the file exists or throw an SmbException.
> I can subsequently make an SmbFileInputStream() from
> the file, but I usually check canRead() first so that I can cleverly
> show the user some nice error message.
You should just try and do the operation and then show the user the message associated with any exception that occurs. Calling canRead give you nothing and costs an extra round trip to the
> Have you seen this?
More information about the jcifs