Example usage for java.nio.file.attribute AclEntry flags

List of usage examples for java.nio.file.attribute AclEntry flags

Introduction

In this page you can find the example usage for java.nio.file.attribute AclEntry flags.

Prototype

Set flags

To view the source code for java.nio.file.attribute AclEntry flags.

Click Source Link

Usage

From source file:Test.java

public static void main(String[] args) throws Exception {
    Path path = Paths.get("C:/home/docs/users.txt");
    AclFileAttributeView view = Files.getFileAttributeView(path, AclFileAttributeView.class);
    List<AclEntry> aclEntryList = view.getAcl();
    for (AclEntry entry : aclEntryList) {
        System.out.println("User Principal Name: " + entry.principal().getName());
        System.out.println("ACL Entry Type: " + entry.type());
        displayEntryFlags(entry.flags());
        displayPermissions(entry.permissions());
        System.out.println();//from w w w  .jav  a  2s .c  o  m
    }
}

From source file:Test.java

private static void displayAclEntries(List<AclEntry> aclEntryList) {
    System.out.println("ACL Entry List size: " + aclEntryList.size());
    for (AclEntry entry : aclEntryList) {
        System.out.println("User Principal Name: " + entry.principal().getName());
        System.out.println("ACL Entry Type: " + entry.type());
        displayEntryFlags(entry.flags());
        displayPermissions(entry.permissions());
        System.out.println();//  w ww . java  2s  . c  o m
    }
}