Class OSUtils
java.lang.Object
com.blackrook.engine.struct.OSUtils
-
Method Summary
Modifier and TypeMethodDescriptionstatic StringCurrent application settings directory.static Stringstatic Filestatic Stringstatic Stringstatic booleanisARM()static booleanisLinux()static booleanisOSX()static booleanisOSX64()static booleanisOSX86()static booleanisOSXPPC()static booleanisPPC()static booleanstatic booleanisWin32()static booleanisWin64()static booleanstatic booleanstatic booleanstatic booleanstatic booleanstatic booleanstatic booleanstatic booleanstatic booleanstatic booleanstatic booleanstatic booleanstatic booleanstatic booleanisX64()static booleanisX86()static booleanAttempts to detect if an executable is present on the platform's PATH by name.
-
Method Details
-
isLinux
public static boolean isLinux()- Returns:
- true if we using a Linux distro.
-
isOSX
public static boolean isOSX()- Returns:
- true if we using Mac OS X.
-
isOSX64
public static boolean isOSX64()- Returns:
- true if we using 64-bit Mac OS X.
-
isOSX86
public static boolean isOSX86()- Returns:
- true if we using x86 Mac OS X.
-
isOSXPPC
public static boolean isOSXPPC()- Returns:
- true if we using Power PC Mac OS X.
-
isPPC
public static boolean isPPC()- Returns:
- true if this is running on an Power PC architecture.
-
isARM
public static boolean isARM()- Returns:
- true if this is running on an ARM architecture.
-
isWin32
public static boolean isWin32()- Returns:
- true if we using 32-bit Windows.
-
isWin64
public static boolean isWin64()- Returns:
- true if we using 64-bit Windows.
-
isWindows
public static boolean isWindows()- Returns:
- true if we using Windows.
-
isWindows2000
public static boolean isWindows2000()- Returns:
- true if we using Windows 2000.
-
isWindows2003
public static boolean isWindows2003()- Returns:
- true if we using Windows 2003.
-
isWindows2008
public static boolean isWindows2008()- Returns:
- true if we using Windows 2008.
-
isWindowsVista
public static boolean isWindowsVista()- Returns:
- true if we using Windows Vista.
-
isWindows7
public static boolean isWindows7()- Returns:
- true if we using Windows 7.
-
isWindows8
public static boolean isWindows8()- Returns:
- true if we using Windows 8.
-
isWindows10
public static boolean isWindows10()- Returns:
- true if we using Windows 10.
-
isWindows11
public static boolean isWindows11()- Returns:
- true if we using Windows 11.
-
isWindows9X
public static boolean isWindows9X()- Returns:
- true if we using Windows 95/98.
-
isWindowsME
public static boolean isWindowsME()- Returns:
- true if we are using Windows ME, or better yet, if we should just kill the program now.
-
isWindowsNT
public static boolean isWindowsNT()- Returns:
- true if we using Windows NT.
-
isWindowsXP
public static boolean isWindowsXP()- Returns:
- true if we using Windows XP.
-
isX64
public static boolean isX64()- Returns:
- true if this is running on an x64 architecture.
-
isX86
public static boolean isX86()- Returns:
- true if this is running on an x86 architecture.
-
isSolaris
public static boolean isSolaris()- Returns:
- true if this is running on Sun Solaris.
-
getWorkingDirectoryPath
- Returns:
- the path to the working directory.
-
getApplicationSettingsPath
Current application settings directory. In Windows, this is set to whatever the APPDATA environment variable is set to. On other operating systems, this is set to whatever the HOME environment variable is set to.- Returns:
- the path to the common application settings directory.
-
getHomeDirectoryPath
- Returns:
- the current user's home directory.
-
getTempDirectoryPath
- Returns:
- the current user's temporary directory.
-
getNullFile
- Returns:
- the "null" file pipe for this operating system.
-
onPath
Attempts to detect if an executable is present on the platform's PATH by name. On Windows, this is done through thewherecommand. On Unix-like systems, thewhichcommand.- Parameters:
imageName- the executable name.- Returns:
- true if so, false if not.
- Throws:
NullPointerException- if imageName is null.UnsupportedOperationException- if a mechanism to search the PATH environment does not exist.
-