Featured Whitepapers
Newsletter sign-up
View all newsletters

Sign up for our technology specific newsletters.

Enterprise Java
Email Address:
JavaWorld Daily Brew

Access deny file to read


I'm running test on Linux.

The file's permission is '-rwxr--r-- root root ...'
But

...
AccessController.checkPermission( new FilePermission( fileName, "read" ) );
...

This line occurs AccessControlException.
Why can't read this file?

I've created '.java.policy'

grant {
permission java.io.FilePermission "/-", "read";
};

So, I can read. But, I can't figure out the result.

Your rating: None