Class OSInformation


  • public class OSInformation
    extends java.lang.Object
    OS specific information, used by the native_capability macro for osgi.native.* bundle properties.
    • Field Detail

      • osnames

        java.lang.String osnames
      • regexQualifierNotAllowedChars

        private static java.lang.String regexQualifierNotAllowedChars
      • digitPattern

        private static java.util.regex.Pattern digitPattern
      • processorFamilies

        static final java.lang.String[][] processorFamilies
      • osarch

        static java.lang.String[] osarch
    • Constructor Detail

      • OSInformation

        public OSInformation()
                      throws java.lang.IllegalArgumentException
        Construct OS specific information
        Throws:
        java.lang.IllegalArgumentException
      • OSInformation

        public OSInformation​(java.lang.String sysPropOsName,
                             java.lang.String sysPropOsVersion)
                      throws java.lang.IllegalArgumentException
        Throws:
        java.lang.IllegalArgumentException
    • Method Detail

      • getProcessorAliases

        public static java.lang.String[] getProcessorAliases​(java.lang.String osArch)
      • getProcessorAliases

        public static java.lang.String[] getProcessorAliases()
      • convertUnixKernelVersion

        static Version convertUnixKernelVersion​(java.lang.String sysPropOsVersion)

        Convert a generic Unix kernel version to an OSGi version.

        As long as we have digits separated by dots, convert the digits into the respective version segments. Anything left after that conversion is the qualifier. Illegal characters in that qualifier are converted into underscores to ensure that the final qualifier is valid.

        Parameters:
        sysPropOsVersion - the system property "os.version"
      • getNativeCapabilityClause

        public static java.lang.String getNativeCapabilityClause​(Processor p,
                                                                 java.lang.String[] args)
                                                          throws java.lang.Exception
        Helper for the Processor._native_capability macro
        Parameters:
        args - the arguments of the macro
        Returns:
        a provide capability clause for the native environment
        Throws:
        java.lang.Exception
      • createCapability

        static org.osgi.resource.Capability createCapability​(OSInformation.NativeCapability clause)
                                                      throws java.lang.Exception
        Throws:
        java.lang.Exception
      • parseNativeCapabilityArgs

        static void parseNativeCapabilityArgs​(Processor p,
                                              java.lang.String[] args,
                                              OSInformation.NativeCapability clause)
                                       throws java.lang.Exception
        Throws:
        java.lang.Exception
      • getOperatingSystemAliases

        public static OSInformation.OSNameVersion getOperatingSystemAliases​(java.lang.String sysPropOsName,
                                                                            java.lang.String sysPropOsVersion)