Checking Read/Write Permission for a Directory : Permission « Security « Java






Checking Read/Write Permission for a Directory

   

import java.io.FilePermission;
import java.security.AccessController;

public class Main {
  public static void main(String[] argv) throws Exception {
    AccessController.checkPermission(new FilePermission("/tmp/*", "read,write"));

  }
}

   
    
    
  








Related examples in the same category

1.Determining If One Permission Implies Another
2.Creating a Custom Permission
3.extends BasicPermission
4.boolean Permission.implies(Permission permission)
5.Controlling Access to an Object using a permission
6.Guard guard = new PropertyPermission("java.home", "read");
7.Listing All Permissions Granted to a Loaded Class
8.new GuardedObject(Object obj, Guard)
9.Object GuardedObject.getObject()
10.Execution of reflection