SystemInfo

com.sun.pkg.client

## Class SystemInfo

- java.lang.Object
- - com.sun.pkg.client.SystemInfo

-     public class SystemInfo
      extends java.lang.Object

  `SystemInfo` provides access to system information related to the pkg(5) Java API. This includes information related to the updatetool GUI and bootstrap programs that are built on top of this API. This class can be used to read and write information.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `SystemInfo.UpdateCheckFrequency`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `SystemInfo()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static java.lang.String` | `getCanonicalOSArch()` Get the bitness of the OS.
    `static java.lang.String` | `getOSBitness()` Get the bitness of the OS.
    `static java.net.Proxy` | `getProxy()` Obtain proxy based on the updatetool preferences.
    `static java.net.ProxySelector` | `getProxySelector()` Obtain a ProxySelector based on the updatetool preferences.
    `static SystemInfo.UpdateCheckFrequency` | `getUpdateCheckFrequency()` Obtain the update check frequency based on the updatetool preferences.
    `static void` | `initUpdateToolProps(java.util.Properties props)` Initialize the updatetool preferences from properties.

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### SystemInfo

          public SystemInfo()

  - ### Method Detail

    - #### getOSBitness

          public static java.lang.String getOSBitness()

      Get the bitness of the OS. Note that Java is unable to do this accurately -- so we are really getting the bitness of the JVM.

    - #### getCanonicalOSArch

          public static java.lang.String getCanonicalOSArch()

      Get the bitness of the OS. Get the OS architecture as a canonicalized string. I.e. this will return "i386" if the os.arch is "x86", "i686", "i686_64", etc.

    - #### getProxySelector

          public static java.net.ProxySelector getProxySelector()

      Obtain a ProxySelector based on the updatetool preferences.

      This method returns a `ProxySelector` based on the information stored in the updatetool preferences. Proxies returned form this ProxySelector may be null if updatetool is using system proxy settings that are not stored in the updatetool preferences file. To mimic the behavior of using the system proxy settings in Java, use the java.net.useSystemProxies system property. If unable to read the proxy information or if the proxy information is invalid, a ProxySelector is returned that will yield null Proxies and error information is logged.

      Returns:
        a ProxySelector object

    - #### getProxy

          public static java.net.Proxy getProxy()

      Obtain proxy based on the updatetool preferences.

      This method returns a `Proxy` based on the information stored in the updatetool preferences. This method may return null if updatetool is using system proxy settings that are not stored in the updatetool preferences file. To mimic the behavior of using the system proxy settings in Java, use the java.net.useSystemProxies system property. If unable to read the proxy information or if the proxy information is invalid, null is returned and error information is logged.

      Returns:
        a Proxy object

    - #### getUpdateCheckFrequency

          public static SystemInfo.UpdateCheckFrequency getUpdateCheckFrequency()

      Obtain the update check frequency based on the updatetool preferences.

      If the user has opted out of update notifications, NEVER is returned. Otherwise the value for the update check frequence is returned. If there is no setting, the default value is WEEKLY.

      Returns:
        an UpdateCheckFrequency

    - #### initUpdateToolProps

          public static void initUpdateToolProps(java.util.Properties props)
                                          throws java.lang.Exception

      Initialize the updatetool preferences from properties.

      This method passes preferences information to the updatetool program by writing values to an updatetool initialization configuration file. When updatetool next runs, it merges the initialization information into its preferences file.

      The properties recognized from the props object are:

      - optin.update.notification
      - image.path
      - proxy.URL
      If the value for a property is missing, no change is made for that property. To make updatetool use no proxy, pass in the empty string ("") for the proxy.URL value.
      Parameters:
        `props` - - values to use for writing the file
      Throws:
        `java.lang.Exception`