public List < String > listProperties ( String wmiClass ) throws WMIException { List < String > foundPropertiesList = new ArrayList < String > ( ) ; try { String rawData = getWMIStub ( ) . listProperties ( wmiClass , this . namespace , this . computerName ) ; String [ ] dataStringLines = rawData . split ( NEWLINE_REGEX ) ; for ( final String line : dataStringLines ) { if ( ! line . isEmpty ( ) ) { foundPropertiesList . add ( line . trim ( ) ) ; } } List < String > notAllowed = Arrays . asList ( new String [ ] { "Equals" , "GetHashCode" , "GetType" , "ToString" } ) ; foundPropertiesList . removeAll ( notAllowed ) ; } catch ( Exception ex ) { Logger . getLogger ( WMI4Java . class . getName ( ) ) . log ( Level . SEVERE , GENERIC_ERROR_MSG , ex ) ; throw new WMIException ( ex ) ; } return foundPropertiesList ; }
Query a WMI class and return all the available properties