Use AccessController to check the AWT permission : AccessController « Security « Java






Use AccessController to check the AWT permission

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

public class MainClass {
  public static void main(String args[]) throws Exception {

    AWTPermission ap = new AWTPermission("accessClipboard");
    AccessController.checkPermission(ap);
  }
}

   
  








Related examples in the same category

1.Use AccessController to check the file permission
2.Make AccessibleObject Accessible
3.AccessController.doPrivileged(new PrivilegedAction() )
4. ClassLoader java.security.AccessController.doPrivileged(PrivilegedAction action)
5.Security Support
6.Load class
7.Search for resource in different places.
8.Lock request from going up in the classloader hierarchy