Newsletter sign-up
View all newsletters

Enterprise Java Newsletter
Stay up to date on the latest tutorials and Java community news posted on JavaWorld

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.