im trying to get directory permissions via the checkPermission() method, as in the code.
private static boolean dirPermissions(String dir, String perm) {
Firstly you should probably be using the SecurityManager
.
FilePermission
copes with directories fine. You probably want to include all the files and directories included below. Use /-
at the end for that. Use /*
for non-recursive contained files and directories.
checkPermission
will throw an exception if any frame (or rather its ProtectionDomain
) of the current access control context (acc) does not have the required permission.
FilePermission
has nothing to do with OS permissions.