Class UserGroupInfo

java.lang.Object
oshi.driver.linux.proc.UserGroupInfo

@ThreadSafe
public final class UserGroupInfo
extends java.lang.Object
Utility class to temporarily cache the userID and group maps in Linux, for parsing process ownership. Cache expires after one minute.
  • Method Summary

    Modifier and Type Method Description
    static java.lang.String getGroupName​(java.lang.String groupId)
    Gets the group name for a given ID
    static java.lang.String getUser​(java.lang.String userId)
    Gets a user from their ID

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • getUser

      public static java.lang.String getUser​(java.lang.String userId)
      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

      public static java.lang.String getGroupName​(java.lang.String groupId)
      Gets the group name for a given ID
      Parameters:
      groupId - a String object.
      Returns:
      a String object.