Class UserGroupInfo
java.lang.Object
oshi.util.UserGroupInfo
Utility class to temporarily cache the userID and group maps in *nix, for
parsing process ownership. Cache expires after one minute.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static StringgetentGroup(String groupId) private static StringgetentPasswd(String userId) static StringgetGroupName(String groupId) Gets the group name for a given IDstatic StringGets a user from their IDstatic booleanDetermine whether the current process has elevated permissions such as sudo / AdministratorparseGroup(List<String> group) parsePasswd(List<String> passwd)
-
Field Details
-
USERS_ID_MAP
-
GROUPS_ID_MAP
-
ELEVATED
private static final boolean ELEVATED
-
-
Constructor Details
-
UserGroupInfo
private UserGroupInfo()
-
-
Method Details
-
isElevated
public static boolean isElevated()Determine whether the current process has elevated permissions such as sudo / Administrator- Returns:
- True if this process has elevated permissions
-
getUser
-
getGroupName
-
getUserMap
-
getentPasswd
-
parsePasswd
-
getGroupMap
-
getentGroup
-
parseGroup
-