Class OSInfo.Windows.WMI

  • Enclosing class:
    OSInfo.Windows

    public static final class OSInfo.Windows.WMI
    extends java.lang.Object
    Returns information from WMI.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void executeDemoQueries()  
      static java.lang.String getEnvironmentVar​(java.lang.String variableName)
      Get an environment variable from Windows.
      static java.lang.String getWMIValue​(java.lang.String wmiQueryStr, java.lang.String wmiCommaSeparatedFieldName)
      Get the given WMI value from the WMI subsystem on the local computer.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • getEnvironmentVar

        public static java.lang.String getEnvironmentVar​(java.lang.String variableName)
                                                  throws java.io.IOException,
                                                         java.lang.InterruptedException
        Get an environment variable from Windows.
        Parameters:
        variableName - The name of the environment variable to get
        Returns:
        The value of the environment variable
        Throws:
        java.io.IOException - if error occurs
        java.lang.InterruptedException - if command is interrupted
        java.lang.IllegalArgumentException - if Environment Variable does't exist
      • getWMIValue

        public static java.lang.String getWMIValue​(java.lang.String wmiQueryStr,
                                                   java.lang.String wmiCommaSeparatedFieldName)
                                            throws java.io.IOException,
                                                   java.lang.InterruptedException
        Get the given WMI value from the WMI subsystem on the local computer.
        Parameters:
        wmiQueryStr - the query string as syntactically defined by the WMI reference
        wmiCommaSeparatedFieldName - the field object that you want to get out of the query results
        Returns:
        the value
        Throws:
        java.io.IOException - if error occurs
        java.lang.InterruptedException - if command is interrupted
      • executeDemoQueries

        public static void executeDemoQueries()
                                       throws java.io.IOException,
                                              java.lang.InterruptedException
        Throws:
        java.io.IOException
        java.lang.InterruptedException