java.lang.Object
org.jhotdraw8.os.macos.MacOSPreferencesUtil
Provides read methods for some well known macOS preferences files.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidClears all caches.static voidclearCache(File f) Clears the cache for the specified preference file.static @Nullable ObjectGets a preferences valuestatic ObjectGet a value from a Mac OS X preferences file.static @Nullable ObjectReturns all known keys for the specified preferences file.static @Nullable Stringstatic Stringstatic booleanisMacOs()static booleanisStringEqualTo(File file, String key, String defaultValue, String compareWithThisValue) static voidreadPreferences(File file, Map<String, Object> cache)
-
Field Details
-
GLOBAL_PREFERENCES
Path to global preferences. -
FINDER_PREFERENCES
Path to finder preferences.
-
-
Constructor Details
-
MacOSPreferencesUtil
public MacOSPreferencesUtil()Creates a new instance.
-
-
Method Details
-
getString
-
getString
-
isStringEqualTo
-
get
Gets a preferences value- Parameters:
file- the preferences filekey- the key may contain tabulator separated entries to directly access a value in a sub-dictionary- Returns:
- the value associated with the key
-
flatten
-
get
-
getKeySet
Returns all known keys for the specified preferences file.- Returns:
-
clearAllCaches
public static void clearAllCaches()Clears all caches. -
clearCache
Clears the cache for the specified preference file. -
get
Get a value from a Mac OS X preferences file.- Parameters:
file- The preferences file.key- Hierarchical keys are separated by \t characters.defaultValue- This value is returned when the key does not exist.- Returns:
- Returns the preferences value.
-
isMacOs
public static boolean isMacOs() -
readPreferences
-