Class OSUtils

java.lang.Object
com.blackrook.engine.struct.OSUtils

public final class OSUtils extends Object
Simple OS utility functions.
Author:
Matthew Tropiano
  • 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

      public static String getWorkingDirectoryPath()
      Returns:
      the path to the working directory.
    • getApplicationSettingsPath

      public static String 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

      public static String getHomeDirectoryPath()
      Returns:
      the current user's home directory.
    • getTempDirectoryPath

      public static String getTempDirectoryPath()
      Returns:
      the current user's temporary directory.
    • getNullFile

      public static File getNullFile()
      Returns:
      the "null" file pipe for this operating system.
    • onPath

      public static boolean onPath(String imageName)
      Attempts to detect if an executable is present on the platform's PATH by name. On Windows, this is done through the where command. On Unix-like systems, the which command.
      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.