// update file if changed
fileContent.reloadIfUpdated();
Feature feature = featureState.getFeature();
Editor editor = fileContent.getEditor();
// enabled
String enabledKey = getEnabledPropertyName(feature);
String enabledValue = featureState.isEnabled() ? "true" : "false";
editor.setValue(enabledKey, enabledValue);
// write strategy id, will be removed if it is null
editor.setValue(getStrategyPropertyName(feature), featureState.getStrategyId());
// parameters
String paramPrefix = getParameterPropertyName(feature, "");
editor.removeKeysStartingWith(paramPrefix);
for (String id : featureState.getParameterNames()) {
String key = getParameterPropertyName(feature, id);
editor.setValue(key, featureState.getParameter(id));
}
// remove the old users property if it still exists from the old format
editor.setValue(getUsersPropertyName(feature), null);
// write
editor.commit();
}