File access permissions are controlled by blocks with the following syntax:
Code:
grant {
permission java.io.FilePermission "filePath", "permissionList";
};
where filePath is the path of the file, of part of the file system to be accessed, and permissionList is a comma-separated list of [some combination of] the words read, write, delete and execute. Note that filePath can make use of two wildcards that should appear at the end of filePath. A '*' means 'all files in current directory', and a '-' means 'all files in the current directory and [recusively] all subdirectories'. There can be multiple permission lines. For example
Code:
grant {
permission java.io.FilePermission "/home/eric/-", "read";
permission java.io.FilePermission "/home/eric/temp/*", "read, write, delete";
}
A Windows example might be:
Code:
grant {
permission java.io.FilePermission "C:\\home\\download\\-", "read";
permission java.io.FilePermission "C:\\home\\download\\temp\\*", "read, write, delete";
}
Note the double \\'s for Windows.
grants read access to all files and subdirectories in '/home/eric/', but only files in '/home/eric/temp' can be written or deleted.
Bookmarks