Example usage for java.io FilePermission equals

List of usage examples for java.io FilePermission equals

Introduction

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

Prototype

@Override
public boolean equals(Object obj) 

Source Link

Document

Checks two FilePermission objects for equality.

Usage

From source file:Main.java

public static void main(String[] args) throws IOException {
    FilePermission fp = new FilePermission("C://test.txt", "read");
    FilePermission fp1 = new FilePermission("C://test1.txt", "read");
    FilePermission fp2 = new FilePermission("C://test.txt", "write");
    FilePermission fp3 = new FilePermission("C://test.txt", "read");

    boolean bool = fp.equals(fp1);

    System.out.println(bool);//  w ww  .  j ava 2s .  c  o m

    bool = fp.equals(fp2);

    System.out.println(bool);

    bool = fp.equals(fp3);
    System.out.print(bool);
}