Example usage for java.lang SecurityManager checkLink

List of usage examples for java.lang SecurityManager checkLink

Introduction

In this page you can find the example usage for java.lang SecurityManager checkLink.

Prototype

public void checkLink(String lib) 

Source Link

Document

Throws a SecurityException if the calling thread is not allowed to dynamic link the library code specified by the string argument file.

Usage

From source file:Main.java

public static void main(String[] args) {
    System.setProperty("java.security.policy", "file:/C:/java.policy");

    SecurityManager sm = new SecurityManager();

    System.setSecurityManager(sm);

    sm.checkLink("JDBC");

    System.out.println("Allowed!");
}