Example usage for java.io FilePermission implies

List of usage examples for java.io FilePermission implies

Introduction

In this page you can find the example usage for java.io FilePermission implies.

Prototype

@Override
public boolean implies(Permission p) 

Source Link

Document

Checks if this FilePermission object "implies" the specified permission.

Usage

From source file:Main.java

public static void main(String[] args) throws IOException {

    // create new file permissions
    FilePermission fp = new FilePermission("C://test.txt", "read");
    FilePermission fp1 = new FilePermission("C://test.txt", "write");
    FilePermission fp2 = new FilePermission("C://test1.txt", "read");
    FilePermission fp3 = new FilePermission("C://test.txt", "read");

    // tests if implied by this object
    boolean bool = fp.implies(fp1);

    // print/*from   w  ww  .j  a va2 s . c o  m*/
    System.out.println(bool);

    bool = fp.implies(fp2);
    System.out.println(bool);

    bool = fp.implies(fp3);
    System.out.print(bool);

}