Class Os


  • public final class Os
    extends java.lang.Object
    Class to help determining the OS.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static OsFamily getFamily​(java.lang.String name)
      Locates an OsFamily by name (case-insensitive).
      static boolean isArch​(java.lang.String arch)
      Determines if the OS on which Ant is executing matches the given OS architecture.
      static boolean isFamily​(java.lang.String family)
      Determines if the OS on which Ant is executing matches the given OS family.
      static boolean isFamily​(OsFamily family)
      Determines if the OS on which Ant is executing matches the given OS family.
      static boolean isName​(java.lang.String name)
      Determines if the OS on which Ant is executing matches the given OS name.
      static boolean isOs​(java.lang.String family, java.lang.String name, java.lang.String arch, java.lang.String version)
      Determines if the OS on which Ant is executing matches the given OS family, name, architecture and version.
      static boolean isOs​(OsFamily family, java.lang.String name, java.lang.String arch, java.lang.String version)
      Determines if the OS on which Ant is executing matches the given OS family, name, architecture and version.
      static boolean isVersion​(java.lang.String version)
      Determines if the OS on which Ant 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
    • Method Detail

      • isVersion

        public static boolean isVersion​(java.lang.String version)
        Determines if the OS on which Ant is executing matches the given OS version.
        Parameters:
        version - The version to check.
        Returns:
        true if the version matches.
      • isArch

        public static boolean isArch​(java.lang.String arch)
        Determines if the OS on which Ant is executing matches the given OS architecture.
        Parameters:
        arch - The architecture to check.
        Returns:
        true if the architecture mataches.
      • isFamily

        public static boolean isFamily​(java.lang.String family)
        Determines if the OS on which Ant is executing matches the given OS family.
        Parameters:
        family - The family to check.
        Returns:
        true if the family matches.
      • isFamily

        public static boolean isFamily​(OsFamily family)
        Determines if the OS on which Ant is executing matches the given OS family.
        Parameters:
        family - The family to check.
        Returns:
        true if the family matches.
      • isName

        public static boolean isName​(java.lang.String name)
        Determines if the OS on which Ant is executing matches the given OS name.
        Parameters:
        name - Description of Parameter
        Returns:
        The Name value
        Since:
        1.7
      • isOs

        public static boolean isOs​(java.lang.String family,
                                   java.lang.String name,
                                   java.lang.String arch,
                                   java.lang.String version)
        Determines if the OS on which Ant 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:
        The Os value
      • isOs

        public static boolean isOs​(OsFamily family,
                                   java.lang.String name,
                                   java.lang.String arch,
                                   java.lang.String version)
        Determines if the OS on which Ant 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:
        The Os value
      • getFamily

        public static OsFamily getFamily​(java.lang.String name)
        Locates an OsFamily by name (case-insensitive).
        Parameters:
        name - The family name to lookup.
        Returns:
        the OS family, or null if not found.