f



How to determine whether a file doesn't exist or doesn't have enough permissions

Hello everone,
I am stuck in determining whether a file does not exist or does not
have enough permissions so that access to this file is denied?". I am
using
java.io.File.exists() or java.io.File.canRead() methods to check this
but both of them just return false in both above mentioned cases.
In the documentation however its mentioned that these method throw
SecurityException - If a security manager exists and its
SecurityManager.checkRead(java.lang.String) method denies read access
to the file. But then problem is to write a security manager which
denies
read access if the file does not have permissions so that exception
can the thrown.

Any suggestions or pointers will be highly appreciated.

Thank You.

Regards,
Vikash Kumar
0
vikashskumar
3/17/2005 9:21:53 AM
comp.lang.java.security 1502 articles. 0 followers. Post Follow

0 Replies
1428 Views

Similar Articles

[PageSpeed] 31

Reply: