public static FSDataOutputStream create ( FileSystem fs , Path file , FsPermission permission ) throws IOException { // create the file with default permission FSDataOutputStream out = fs . create ( file ) ; // set its permission to the supplied one fs . setPermission ( file , permission ) ; return out ; }
create a file with the provided permission The permission of the file is set to be the provided permission as in setPermission not permission&~umask