Java SecurityManager .checkLink (String lib)

Syntax

SecurityManager.checkLink(String lib) has the following syntax.

public void checkLink(String lib)

Example

In the following code shows how to use SecurityManager.checkLink(String lib) method.


/*  www  .j a  v a  2  s. c om*/
public class Main {

   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!");
   }
}




















Home »
  Java Tutorial »
    java.lang »




Boolean
Byte
Character
Class
Double
Enum
Float
Integer
Long
Math
Number
Object
Package
Process
ProcessBuilder
Runnable
Runtime
SecurityManager
Short
StackTraceElement
StrictMath
String
StringBuffer
StringBuilder
System
Thread
ThreadGroup
ThreadLocal
Throwable