Class OS

java.lang.Object
org.apache.commons.exec.OS

public final class OS extends Object
Condition that tests the OS type. Copied and adapted from Apache Ant 1.9.6 from org.apache.tools.ant.taskdefs.condition.OS.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    OS family that can be tested for.
    static final String
    OS family that can be tested for.
    static final String
    OS family that can be tested for.
    static final String
    OS family that can be tested for.
    static final String
    OS family that can be tested for.
    static final String
    OS family that can be tested for.
    static final String
    OS family that can be tested for.
    static final String
    OS family that can be tested for.
    static final String
    OS family that can be tested for.
    static final String
    OS family that can be tested for.
    static final String
    OS family that can be tested for.
    static final String
    OS family that can be tested for.
  • Method Summary

    Modifier and Type
    Method
    Description
    static boolean
    isArch(String arch)
    Tests whether the OS on which commons-exec is executing matches the given OS architecture.
    static boolean
    Tests whether the OS is in the DOS family.
    static boolean
    Tests whether the OS is in the Mac family.
    static boolean
    Tests whether the OS is in the Netware family.
    static boolean
    Tests whether the OS is in the OpenVMS family.
    static boolean
    Tests whether the OS is in the OS/2 family.
    static boolean
    Tests whether the OS is in the OS/400 family.
    static boolean
    Tests whether the OS is in the Tandem family.
    static boolean
    Tests whether the OS is in the Unix family.
    static boolean
    Tests whether the OS is in the Windows 9x family.
    static boolean
    Tests whether the OS is in the Windows family.
    static boolean
    Tests whether the OS is in the Windows NT family.
    static boolean
    Tests whether the OS is in the z/OS family.
    static boolean
    isName(String name)
    Tests whether if the OS on which commons-exec is executing matches the given OS name.
    static boolean
    isOs(String family, String name, String arch, String version)
    Tests whether the OS on which commons-exec is executing matches the given OS family, name, architecture and version.
    static boolean
    isVersion(String version)
    Tests whether the OS on which commonss-exec is executing matches the given OS version.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Method Details

    • isArch

      public static boolean isArch(String arch)
      Tests whether the OS on which commons-exec is executing matches the given OS architecture.
      Parameters:
      arch - the OS architecture to check for.
      Returns:
      whether if the OS matches.
    • isFamilyDOS

      public static boolean isFamilyDOS()
      Tests whether the OS is in the DOS family.
      Returns:
      whether the OS is in the DOS family.
    • isFamilyMac

      public static boolean isFamilyMac()
      Tests whether the OS is in the Mac family.
      Returns:
      whether the OS is in the Mac family.
    • isFamilyNetware

      public static boolean isFamilyNetware()
      Tests whether the OS is in the Netware family.
      Returns:
      whether the OS is in the Netware family.
    • isFamilyOpenVms

      public static boolean isFamilyOpenVms()
      Tests whether the OS is in the OpenVMS family.
      Returns:
      whether the OS is in the OpenVMS family.
    • isFamilyOS2

      public static boolean isFamilyOS2()
      Tests whether the OS is in the OS/2 family.
      Returns:
      whether the OS is in the OS/2 family.
    • isFamilyOS400

      public static boolean isFamilyOS400()
      Tests whether the OS is in the OS/400 family.
      Returns:
      whether the OS is in the OS/400 family.
    • isFamilyTandem

      public static boolean isFamilyTandem()
      Tests whether the OS is in the Tandem family.
      Returns:
      whether the OS is in the Tandem family.
    • isFamilyUnix

      public static boolean isFamilyUnix()
      Tests whether the OS is in the Unix family.
      Returns:
      whether the OS is in the Unix family.
    • isFamilyWin9x

      public static boolean isFamilyWin9x()
      Tests whether the OS is in the Windows 9x family.
      Returns:
      whether the OS is in the Windows 9x family.
    • isFamilyWindows

      public static boolean isFamilyWindows()
      Tests whether the OS is in the Windows family.
      Returns:
      whether the OS is in the Windows family.
    • isFamilyWinNT

      public static boolean isFamilyWinNT()
      Tests whether the OS is in the Windows NT family.
      Returns:
      whether the OS is in the Windows NT family.
    • isFamilyZOS

      public static boolean isFamilyZOS()
      Tests whether the OS is in the z/OS family.
      Returns:
      whether the OS is in the z/OS family.
    • isName

      public static boolean isName(String name)
      Tests whether if the OS on which commons-exec is executing matches the given OS name.
      Parameters:
      name - the OS name to check for.
      Returns:
      whether the OS matches.
    • isOs

      public static boolean isOs(String family, String name, String arch, String version)
      Tests whether the OS on which commons-exec is executing matches the given OS family, name, architecture and version.
      Parameters:
      family - The OS family.
      name - The OS name.
      arch - The OS architecture.
      version - The OS version.
      Returns:
      whether the OS matches.
    • isVersion

      public static boolean isVersion(String version)
      Tests whether the OS on which commonss-exec is executing matches the given OS version.
      Parameters:
      version - the OS version to check for.
      Returns:
      whether if the OS matches.