Example usage for org.apache.hadoop.fs.permission FsAction getFsAction

List of usage examples for org.apache.hadoop.fs.permission FsAction getFsAction

Introduction

In this page you can find the example usage for org.apache.hadoop.fs.permission FsAction getFsAction.

Prototype

public static FsAction getFsAction(String permission) 

Source Link

Document

Get the FsAction enum for String representation of permissions

Usage

From source file:alluxio.underfs.hdfs.acl.SupportedHdfsAclProvider.java

License:Apache License

private AclEntry getHdfsAclEntry(alluxio.security.authorization.AclEntry entry) throws IOException {
    AclEntry.Builder builder = new AclEntry.Builder();
    // Do not set name for unnamed entries
    if (entry.getType() != alluxio.security.authorization.AclEntryType.OWNING_USER
            && entry.getType() != alluxio.security.authorization.AclEntryType.OWNING_GROUP) {
        builder.setName(entry.getSubject());
    }//from   w  w w  . j a  v  a2  s . c  o m

    builder.setScope(entry.isDefault() ? AclEntryScope.DEFAULT : AclEntryScope.ACCESS);
    builder.setType(getHdfsAclEntryType(entry));
    FsAction permission = FsAction.getFsAction(entry.getActions().toCliString());
    builder.setPermission(permission);
    return builder.build();
}