public static FsPermission getFilePermissions(final FileSystem fs, final Configuration conf,
    final String permssionConfKey) {
    boolean enablePermissions = conf.getBoolean(HConstants.ENABLE_DATA_FILE_UMASK, false);

    if (enablePermissions) {
      try {
        FsPermission perm = new FsPermission(FULL_RWX_PERMISSIONS);
        // make sure that we have a mask, if not, go default.
        String mask = conf.get(permssionConfKey);
        if (mask == null) {
          return FsPermission.getFileDefault();
        }
        // appy the umask
        FsPermission umask = new FsPermission(mask);
        return perm.applyUMask(umask);
      } catch (IllegalArgumentException e) {
        LOG.warn("Incorrect umask attempted to be created: " + conf.get(permssionConfKey)
          + ", using default file permissions.", e);
        return FsPermission.getFileDefault();
      }
    }
    return FsPermission.getFileDefault();
  }
Get the file permissions specified in the configuration, if they are enabled.
@param fs               filesystem that the file will be created on.
@param conf             configuration to read for determining if permissions are enabled and
                        which to use
@param permssionConfKey property key in the configuration to use when finding the permission
@return the permission to use when creating a new file on the fs. If special permissions are
        not specified in the configuration, then the default permissions on the the fs will be
        returned.
hbase-common/src/main/java/org/apache/hadoop/hbase/util/CommonFSUtils.java