Example usage for org.apache.hadoop.util Shell SET_PERMISSION_COMMAND

List of usage examples for org.apache.hadoop.util Shell SET_PERMISSION_COMMAND

Introduction

In this page you can find the example usage for org.apache.hadoop.util Shell SET_PERMISSION_COMMAND.

Prototype

String SET_PERMISSION_COMMAND

To view the source code for org.apache.hadoop.util Shell SET_PERMISSION_COMMAND.

Click Source Link

Document

a Unix command to set permission: .

Usage

From source file:hdfs.FileUtil.java

License:Apache License

private static void execSetPermission(File f, FsPermission permission) throws IOException {
    if (NativeIO.isAvailable()) {
        // NativeIO.chmod(f.getCanonicalPath(), permission.toShort());
    } else {/*from   w w  w  . jav a  2s.c  om*/
        execCommand(f, Shell.SET_PERMISSION_COMMAND, String.format("%04o", permission.toShort()));
    }
}

From source file:org.apache.hadoop.fs.FileUtil.java

License:Apache License

private static void execSetPermission(File f, FsPermission permission) throws IOException {
    if (NativeIO.isAvailable()) {
        NativeIO.chmod(f.getCanonicalPath(), permission.toShort());
    } else {//from w  w  w.  j  a  v a2  s  .  co m
        execCommand(f, Shell.SET_PERMISSION_COMMAND, String.format("%04o", permission.toShort()));
    }
}