Java Code Examples for org.apache.hadoop.fs.permission.PermissionStatus#getGroupName()

The following examples show how to use org.apache.hadoop.fs.permission.PermissionStatus#getGroupName() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: FSDirMkdirOp.java    From hadoop with Apache License 2.0 5 votes vote down vote up
private static PermissionStatus addImplicitUwx(PermissionStatus parentPerm,
    PermissionStatus perm) {
  FsPermission p = parentPerm.getPermission();
  FsPermission ancestorPerm = new FsPermission(
      p.getUserAction().or(FsAction.WRITE_EXECUTE),
      p.getGroupAction(),
      p.getOtherAction());
  return new PermissionStatus(perm.getUserName(), perm.getGroupName(),
      ancestorPerm);
}
 
Example 2
Source File: AzureNativeFileSystemStore.java    From hadoop with Apache License 2.0 5 votes vote down vote up
@Override
public void toJSON(Object obj, JSON.Output out) {
  PermissionStatus permissionStatus = (PermissionStatus) obj;
  // Don't store group as null, just store it as empty string
  // (which is FileStatus behavior).
  String group = permissionStatus.getGroupName() == null ? ""
      : permissionStatus.getGroupName();
  out.add(OWNER_TAG, permissionStatus.getUserName());
  out.add(GROUP_TAG, group);
  out.add(PERMISSIONS_TAG, permissionStatus.getPermission().toString());
}
 
Example 3
Source File: FSDirMkdirOp.java    From big-c with Apache License 2.0 5 votes vote down vote up
private static PermissionStatus addImplicitUwx(PermissionStatus parentPerm,
    PermissionStatus perm) {
  FsPermission p = parentPerm.getPermission();
  FsPermission ancestorPerm = new FsPermission(
      p.getUserAction().or(FsAction.WRITE_EXECUTE),
      p.getGroupAction(),
      p.getOtherAction());
  return new PermissionStatus(perm.getUserName(), perm.getGroupName(),
      ancestorPerm);
}
 
Example 4
Source File: AzureNativeFileSystemStore.java    From big-c with Apache License 2.0 5 votes vote down vote up
@Override
public void toJSON(Object obj, JSON.Output out) {
  PermissionStatus permissionStatus = (PermissionStatus) obj;
  // Don't store group as null, just store it as empty string
  // (which is FileStatus behavior).
  String group = permissionStatus.getGroupName() == null ? ""
      : permissionStatus.getGroupName();
  out.add(OWNER_TAG, permissionStatus.getUserName());
  out.add(GROUP_TAG, group);
  out.add(PERMISSIONS_TAG, permissionStatus.getPermission().toString());
}