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.
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
getGroupName
(String groupId) Gets the group name for a given IDstatic String
Gets a user from their IDstatic boolean
Determine whether the current process has elevated permissions such as sudo / Administrator
-
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
Gets a user from their ID- Parameters:
userId
- a user ID- Returns:
- a pair containing that user id as the first element and the user name as the second
-
getGroupName
Gets the group name for a given ID
-