oshi.util.UserGroupInfo Maven / Gradle / Ivy
The newest version!
/*
* Copyright 2022 The OSHI Project Contributors
* SPDX-License-Identifier: MIT
*/
package oshi.util;
import static oshi.util.Memoizer.memoize;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.TimeUnit;
import java.util.function.Supplier;
import com.sun.jna.Platform;
import oshi.annotation.concurrent.ThreadSafe;
/**
* Utility class to temporarily cache the userID and group maps in *nix, for parsing process ownership. Cache expires
* after one minute.
*/
@ThreadSafe
public final class UserGroupInfo {
// Temporarily cache users and groups, update each minute
private static final Supplier