Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Slashes in the policy file

 
David Duran
Ranch Hand
Posts: 122
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does anyone know how to specify an os-independent slash in an RMI policy file?

Is there a way to specify something like file.separator within the policy file?
 
Junaid Bhatra
Ranch Hand
Posts: 213
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can do that using ${/} in the policy file.
For eg:
permission java.io.FilePermission "${/}mydir${/}-", "read,write,delete,execute";
In the codebase specifier however, it should always be a / since it is a URL, (even though you may point it to a local file).
For eg:
grant codeBase "file:/c:/myhome/-" {
permission java.io.FilePermission "${/}mydir${/}-", "read,write,delete,execute";
};
You can even utilize system properties. For eg:
grant codeBase "file:/${user.home}/-" {
permission java.io.FilePermission "${user.home}${/}-", "read,write,delete,execute";
};
[ May 14, 2002: Message edited by: Junaid Bhatra ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic