tags:

views:

318

answers:

2

grant { permission java.security.AllPermission; };

This works.

grant file:///- { permission java.security.AllPermission; };

This does not work. Could someone please explain to me why?

+1  A: 

The directive "grant { permission }" means grant the permission to all code no matter where it came from. In other words, when there is no codebase specified, the code could be loaded from the network or the file system.

The second directive (if it worked) would only apply to the local file system. It would be specifying all files (recursively) on the local file system. I'm not sure that "file:///" is a valid URL by itself. I know that file:///tmp/- works.

David G
+1  A: 

The syntax should be:

grant codeBase "file:///-" { 
   ...
};

See the docs. Note the semicolon.

Be very careful assigning permissions to code.

Are you sure the codebase should be a file URL (normal for development, not for production...).

Tom Hawtin - tackline