String[][] xmldevices = XMLDeviceFactory.getDeviceNames(); if (xmldevices != null) { for (int i = 0; i < xmldevices.length; i++) { String deviceName = xmldevices[i][0]; String deviceClass = ":" + xmldevices[i][2]; deviceNames.add(deviceName); inqueryIDProps.setProperty(xmldevices[i][1], deviceClass); deviceProps.setProperty(deviceName, deviceClass);  shortNameProps.setProperty(deviceName, deviceClass); } }
    DevicesConfig() {	// Load properties file	InputStream in = this.getClass().getResourceAsStream("/" + Constants.RESOURCE_NAME_DEVICES_CONFIG);	//Properties configProps = new Properties();	try {	    configProps.load(in);	} catch (IOException e) {	    ErrorMsg.reportError("Failed Loading Devices",				 "Failed loading devices property file. "				 + "Resource " + Constants.RESOURCE_NAME_DEVICES_CONFIG				 + " cannot be loaded", e);	} finally {	    try {		in.close();	    } catch (IOException e) {		// do nothing	    }	}	//configProps.propertyNames()	Enumeration propNames = configProps.propertyNames();	while (propNames.hasMoreElements()) {	    String propName = (String) propNames.nextElement();	    if (propName.startsWith(Constants.PROP_PREFIX_DEVICE_NAME)) {		// /deviceName\./ : Kawai K4/K4R Driver		// /deviceName\./(.*)/		String shortName = propName.substring(Constants.PROP_PREFIX_DEVICE_NAME.length());		String deviceName  = configProps.getProperty(propName);		String deviceClass = configProps.getProperty(Constants.PROP_PREFIX_DEVICE_CLASS + shortName);		String IDString    = configProps.getProperty(Constants.PROP_PREFIX_ID_STRING + shortName);		try {		    deviceNames.add(deviceName);		    // deviceProps: deviceName -> deviceClass		    deviceProps.setProperty(deviceName, deviceClass);		    // inqueryIDProps: inquiry ID String -> deviceName		    inqueryIDProps.setProperty(IDString, deviceClass);		    // shortNameProps: short name String -> deviceName		    shortNameProps.setProperty(shortName, deviceClass);		} catch (NullPointerException e) {		    ErrorMsg.reportError("Failed loading Devices",					 "Config file inconsistency found "					 + "for '" + shortName + "' device");		}		/*	    } else if (propName.startsWith(Constants.PROP_PREFIX_ID_STRING)) {		// /inquiryID\./ : ex. F07E**0602400000040000000000f7		// /inquiryID\./(.*)/		String shortName = propName.substring(Constants.PROP_PREFIX_ID_STRING.length());		//String deviceName = configProps.getProperty(Constants.PROP_PREFIX_DEVICE_NAME + shortName);		String deviceClass = configProps.getProperty(Constants.PROP_PREFIX_DEVICE_CLASS + shortName);		String IDString = configProps.getProperty(Constants.PROP_PREFIX_ID_STRING + shortName);		if ((deviceClass != null) && (IDString != null)) {		    // inqueryIDProps: IDString -> deviceName		    inqueryIDProps.setProperty(IDString, deviceClass);		    //deviceNames.add(deviceName);		} else {		    ErrorMsg.reportError("Failed loading Devices",					 "Config file inconsistency found "					 + "for '" + shortName + "' ID string");		}		*/	    }	}	Collections.sort(deviceNames);    }