diff --git a/src/main/java/com/loafle/overflow/crawler/wmi/WMICrawlerWindows.java b/src/main/java/com/loafle/overflow/crawler/wmi/WMICrawlerWindows.java index e93c75c..379aa3c 100644 --- a/src/main/java/com/loafle/overflow/crawler/wmi/WMICrawlerWindows.java +++ b/src/main/java/com/loafle/overflow/crawler/wmi/WMICrawlerWindows.java @@ -77,18 +77,16 @@ public class WMICrawlerWindows extends WMICrawlerOS { protected OFResultSet getResultSet(EnumVariant enumVariant, Item citem) { - OFResultSet ofResultSet = new OFResultSetCol(citem); + OFResultSet ofResultSet = OFResultSet.newInstance(citem); Variant vItem = null; Dispatch item = null; Variant vValue = null; - String value = null; List row = null; - - List columns = (List)citem.getQueryInfo().get("arrayColumns"); + Map metaMap = ofResultSet.getMeta(); while (enumVariant.hasMoreElements()) { @@ -97,24 +95,13 @@ public class WMICrawlerWindows extends WMICrawlerOS { vItem = enumVariant.nextElement(); item = vItem.toDispatch(); - for( int indexI = 0; indexI < citem.getKeys().size(); ++indexI) { - vValue = Dispatch.call(item, citem.getKeys().get(indexI)); + for( String key : metaMap.keySet()) { + vValue = Dispatch.call(item, key); value = vValue.toString(); vValue.safeRelease(); row.add(value); } - if (columns != null) { - for( int indexI = 0 ; indexI < columns.size(); ++indexI) { - vValue = Dispatch.call(item, columns.get(indexI)); - value = vValue.toString(); - vValue.safeRelease(); - row.add(value); - } - } - - - vItem.safeRelease(); item.safeRelease();