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
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
read access if the file does not have permissions so that exception
can the thrown.
Any suggestions or pointers will be highly appreciated.