3

Is it possible to replace code like:

grant codeBase "file:${home.url}/installed/Engine/lib/runtime_3.jar" {

   // permission for the Engine
   permission java.util.PropertyPermission "*", "read";
   permission java.util.PropertyPermission "*", "write";
};

With code like this:

grant codeBase "file:${home.url}/installed/Engine/lib/runtime_*.jar" {

   // permission for the Engine
   permission java.util.PropertyPermission "*", "read";
   permission java.util.PropertyPermission "*", "write";
};

So as to avoid repeatedly changing the policy file with new versions of libraries?

I've not seen this documented anywhere (and am having a hard time verifying this).

Andrew Thompson
  • 168,117
  • 40
  • 217
  • 433
Ro.
  • 1,357
  • 4
  • 13
  • 25
  • By the time of deployment the Jars will need to be digitally signed, so I cannot see the point of ever touching the policy files, You might as well work out how to digitally sign them during development. – Andrew Thompson Jan 07 '14 at 22:42
  • I want to be able to do this as well. I have all my 3rd party .jar files in the same folder and want to grant specific permissions to a group of them (I have 7 spring .jars to which I want to grant the same permissions for example). Using a wildcard of "spring-*" would be very useful for me. – Mark Douglas Mar 10 '17 at 13:18

1 Answers1

1

No, but you can replace it with this:

grant codeBase "file:${home.url}/installed/Engine/lib/*" {

or this:

grant codeBase "file:${home.url}/installed/Engine/lib/-" {

Rather surprised you didn't find this in the documentation during your extensive research:

A codeBase with a trailing "/*" matches all files (both class and JAR files) contained in that directory. A codeBase with a trailing "/-" matches all files (both class and JAR files) in the directory and recursively all files in subdirectories contained in that directory.
user207421
  • 305,947
  • 44
  • 307
  • 483
  • 1
    Thanks, I don't want to grant permissions to all jars in the directory, just a specific one that gets upgraded every so often. – Ro. Jan 08 '14 at 09:02