Class DefaultOsService

java.lang.Object
org.apache.maven.impl.model.DefaultOsService
All Implemented Interfaces:
Service, OsService

@Named @Singleton public class DefaultOsService extends Object implements OsService
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the OS architecture as reported by the system property "os.arch".
    Returns the OS family name based on OS detection rules.
    boolean
    Checks if the current operating system belongs to the Windows family.
    Returns the OS full name as reported by the system property "os.name".
    Returns the OS version as reported by the system property "os.version".

    Methods inherited from class java.lang.Object

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

    • DefaultOsService

      public DefaultOsService()
  • Method Details

    • name

      @Nonnull public String name()
      Description copied from interface: OsService
      Returns the OS full name as reported by the system property "os.name". The value is converted to lowercase for consistency.
      Specified by:
      name in interface OsService
      Returns:
      the operating system name (never null)
    • arch

      @Nonnull public String arch()
      Description copied from interface: OsService
      Returns the OS architecture as reported by the system property "os.arch". The value is converted to lowercase for consistency.
      Specified by:
      arch in interface OsService
      Returns:
      the operating system architecture (never null)
    • version

      @Nonnull public String version()
      Description copied from interface: OsService
      Returns the OS version as reported by the system property "os.version". The value is converted to lowercase for consistency.
      Specified by:
      version in interface OsService
      Returns:
      the operating system version (never null)
    • family

      @Nonnull public String family()
      Description copied from interface: OsService
      Returns the OS family name based on OS detection rules. This categorizes the OS into one of the supported families (e.g., "windows", "unix", "mac").
      Specified by:
      family in interface OsService
      Returns:
      the operating system family name (never null)
    • isWindows

      public boolean isWindows()
      Description copied from interface: OsService
      Checks if the current operating system belongs to the Windows family. This includes all Windows variants (95, 98, ME, NT, 2000, XP, Vista, 7, 8, 10, 11).
      Specified by:
      isWindows in interface OsService
      Returns:
      true if the current OS is any Windows variant, false otherwise