if (receiverName == null) {
throw new ConfigurationException("openwebif", "Malformed receiver property '" + key
+ "', please check your openhab.cfg!");
}
OpenWebIfConfig rc = OpenWebIf.getConfigs().get(receiverName);
if (rc == null) {
rc = new OpenWebIfConfig();
rc.setName(receiverName);
OpenWebIf.getConfigs().put(receiverName, rc);
}
String keyId = StringUtils.substringAfterLast(key, ".");
if (StringUtils.equalsIgnoreCase(keyId, "host")) {
rc.setHost(value);
} else if (StringUtils.equalsIgnoreCase(keyId, "port")) {
rc.setPort(parseNumber(key, value).intValue());
} else if (StringUtils.equalsIgnoreCase(keyId, "user")) {
rc.setUser(value);
} else if (StringUtils.equalsIgnoreCase(keyId, "password")) {
rc.setPassword(value);
} else if (StringUtils.equalsIgnoreCase(keyId, "https")) {
rc.setHttps(Boolean.parseBoolean(value));
} else {
throw new ConfigurationException("openwebif", "Unknown configuration key '" + key
+ "', please check your openhab.cfg!");
}
}