本文整理汇总了Java中org.apache.hadoop.security.NetgroupCache.getNetgroups方法的典型用法代码示例。如果您正苦于以下问题:Java NetgroupCache.getNetgroups方法的具体用法?Java NetgroupCache.getNetgroups怎么用?Java NetgroupCache.getNetgroups使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.hadoop.security.NetgroupCache
的用法示例。
在下文中一共展示了NetgroupCache.getNetgroups方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getGroups
import org.apache.hadoop.security.NetgroupCache; //导入方法依赖的package包/类
/**
* Get unix groups (parent) and netgroups for given user
*
* @param user get groups and netgroups for this user
* @return groups and netgroups for user
*/
@Override
public List<String> getGroups(String user) throws IOException {
// parent get unix groups
List<String> groups = new LinkedList<String>(super.getGroups(user));
NetgroupCache.getNetgroups(user, groups);
return groups;
}
示例2: getGroups
import org.apache.hadoop.security.NetgroupCache; //导入方法依赖的package包/类
/**
* Gets unix groups and netgroups for the user.
*
* It gets all unix groups as returned by id -Gn but it
* only returns netgroups that are used in ACLs (there is
* no way to get all netgroups for a given user, see
* documentation for getent netgroup)
*/
@Override
public List<String> getGroups(String user) throws IOException {
// parent gets unix groups
List<String> groups = new LinkedList<String>(super.getGroups(user));
NetgroupCache.getNetgroups(user, groups);
return groups;
}