Example usage for java.lang SecurityManager checkPrintJobAccess

List of usage examples for java.lang SecurityManager checkPrintJobAccess

Introduction

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

Prototype

public void checkPrintJobAccess() 

Source Link

Document

Throws a SecurityException if the calling thread is not allowed to initiate a print job request.

Usage

From source file:Main.java

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

    SecurityManager sm = new Main();

    System.setSecurityManager(sm);

    sm.checkPrintJobAccess();

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