* @throws Exception
*/
public void load(Reader in, boolean reload) throws ConfigurationRuntimeException {
Map<String, String> tmpStore = new LinkedHashMap<String, String>();
PropertiesReader reader = new PropertiesReader(in);
try {
while (reader.nextProperty()) {
String key = reader.getPropertyName();
String value = reader.getPropertyValue();
tmpStore.put(key, value);
if(reload) {
String oldValue = store.remove(key);
if(oldValue == null)
fireEvent(EventType.ADD, key, value);
else if(!oldValue.equals(value))
fireEvent(EventType.UPDATE, key, value);
}
}
if(reload) {
for(String key : store.keySet()) {
fireEvent(EventType.CLEAR, key, store.get(key));
}
}
} catch (IOException ioex) {
throw new ConfigurationRuntimeException(ioex);
} finally {
try {
reader.close();
} catch (IOException e) {
;
}
}