Package gaiasky.desktop.util
Class SysUtils
java.lang.Object
gaiasky.desktop.util.SysUtils
public class SysUtils
extends java.lang.Object
Wee utility class to check the operating system and the desktop environment.
It also offers retrieval of common system folders.
-
Constructor Summary
Constructors Constructor Description SysUtils() -
Method Summary
Modifier and Type Method Description static booleancheckBudgie()static booleancheckGnome()static booleancheckI3()static booleancheckKDE()static booleancheckLinuxDesktop(java.lang.String desktop)static booleancheckUnity()static booleancheckXfce()static java.lang.StringgetBookmarksDirName()static java.nio.file.PathgetCacheDir()Returns the default cache directory, for non-essential data.static java.nio.file.PathgetConfigDir()static java.nio.file.PathgetCrashReportsDir()Gets a file pointer to the crash reports directory, where crash reports are stored.static java.nio.file.PathgetDataDir()Returns the default data directory.static java.nio.file.PathgetDefaultBookmarksDir()Gets a file pointer to the bookmarks directory.static java.nio.file.PathgetDefaultCameraDir()Gets a file pointer to the camera directory.static java.nio.file.PathgetDefaultFramesDir()Gets a file pointer to the frames directory.static java.nio.file.PathgetDefaultMappingsDir()Gets a file pointer to the mappings directory.static java.nio.file.PathgetDefaultMpcdiDir()Gets a file pointer to the mpcdi directory.static java.nio.file.PathgetDefaultMusicDir()Gets a file pointer to the music directory.static java.nio.file.PathgetDefaultScreenshotsDir()Gets a file pointer to the default screenshots directory.static java.nio.file.PathgetHomeDir()static doublegetJavaVersion()static java.nio.file.PathgetLocalDataDir()Gets a file pointer to the local data directory where the data files are downloaded and stored.static java.lang.StringgetMappingsDirName()static java.lang.StringgetOSArchitecture()static java.lang.StringgetOSFamily()static java.lang.StringgetOSName()static java.lang.StringgetOSVersion()static java.nio.file.PathgetTempDir(java.lang.String dataLocation)Gets the path to the actual temporary directory in the data folder.static java.nio.file.PathgetUserHome()static java.lang.StringgetXdgDesktop()static booleanisLinux()static booleanisMac()static booleanisSolaris()static booleanisUnix()static booleanisWindows()static booleanlaunchedViaInstall4j()static voidmkdir(java.nio.file.Path dir)static voidmkdirs()Initialise directoriesstatic voidrmdir(java.nio.file.Path dir)Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
SysUtils
public SysUtils()
-
-
Method Details
-
mkdirs
public static void mkdirs()Initialise directories -
mkdir
public static void mkdir(java.nio.file.Path dir) -
rmdir
public static void rmdir(java.nio.file.Path dir) -
getXdgDesktop
public static java.lang.String getXdgDesktop() -
checkLinuxDesktop
public static boolean checkLinuxDesktop(java.lang.String desktop) -
checkUnity
public static boolean checkUnity() -
checkGnome
public static boolean checkGnome() -
checkKDE
public static boolean checkKDE() -
checkXfce
public static boolean checkXfce() -
checkBudgie
public static boolean checkBudgie() -
checkI3
public static boolean checkI3() -
getOSName
public static java.lang.String getOSName() -
getOSFamily
public static java.lang.String getOSFamily() -
isLinux
public static boolean isLinux() -
isWindows
public static boolean isWindows() -
isMac
public static boolean isMac() -
isUnix
public static boolean isUnix() -
isSolaris
public static boolean isSolaris() -
launchedViaInstall4j
public static boolean launchedViaInstall4j() -
getOSArchitecture
public static java.lang.String getOSArchitecture() -
getOSVersion
public static java.lang.String getOSVersion() -
getDefaultCameraDir
public static java.nio.file.Path getDefaultCameraDir()Gets a file pointer to the camera directory.- Returns:
- A pointer to the Gaia Sky camera directory
-
getDefaultScreenshotsDir
public static java.nio.file.Path getDefaultScreenshotsDir()Gets a file pointer to the default screenshots directory.- Returns:
- A pointer to the Gaia Sky screenshots directory
-
getDefaultFramesDir
public static java.nio.file.Path getDefaultFramesDir()Gets a file pointer to the frames directory.- Returns:
- A pointer to the Gaia Sky frames directory
-
getDefaultMusicDir
public static java.nio.file.Path getDefaultMusicDir()Gets a file pointer to the music directory.- Returns:
- A pointer to the Gaia Sky music directory
-
getDefaultMappingsDir
public static java.nio.file.Path getDefaultMappingsDir()Gets a file pointer to the mappings directory.- Returns:
- A pointer to the Gaia Sky mappings directory
-
getMappingsDirName
public static java.lang.String getMappingsDirName() -
getDefaultBookmarksDir
public static java.nio.file.Path getDefaultBookmarksDir()Gets a file pointer to the bookmarks directory.- Returns:
- A pointer to the Gaia Sky bookmarks directory
-
getBookmarksDirName
public static java.lang.String getBookmarksDirName() -
getDefaultMpcdiDir
public static java.nio.file.Path getDefaultMpcdiDir()Gets a file pointer to the mpcdi directory.- Returns:
- A pointer to the Gaia Sky mpcdi directory
-
getLocalDataDir
public static java.nio.file.Path getLocalDataDir()Gets a file pointer to the local data directory where the data files are downloaded and stored.- Returns:
- A pointer to the local data directory where the data files are
-
getCrashReportsDir
public static java.nio.file.Path getCrashReportsDir()Gets a file pointer to the crash reports directory, where crash reports are stored.- Returns:
- A pointer to the crash reports directory
-
getTempDir
public static java.nio.file.Path getTempDir(java.lang.String dataLocation)Gets the path to the actual temporary directory in the data folder. It needs the location of the user-configured data folder as input.- Parameters:
dataLocation- The user-defined data location.- Returns:
- A path that points to the temporary directory.
-
getDataDir
public static java.nio.file.Path getDataDir()Returns the default data directory. That is ~/.gaiasky/ in Windows and macOS, and ~/.local/share/gaiasky in Linux.- Returns:
- Default data directory
-
getCacheDir
public static java.nio.file.Path getCacheDir()Returns the default cache directory, for non-essential data. This is ~/.gaiasky/ in Windows and macOS, and ~/.cache/gaiasky in Linux.- Returns:
- The default cache directory
-
getConfigDir
public static java.nio.file.Path getConfigDir() -
getHomeDir
public static java.nio.file.Path getHomeDir() -
getUserHome
public static java.nio.file.Path getUserHome() -
getJavaVersion
public static double getJavaVersion()
-