public void setCustomInternal(final String iName, final String iValue) {
if (iValue == null || "null".equalsIgnoreCase(iValue)) {
// REMOVE
for (Iterator<OStorageEntryConfiguration> it = storage.getConfiguration().properties.iterator(); it.hasNext();) {
final OStorageEntryConfiguration e = it.next();
if (e.name.equals(iName)) {
it.remove();
break;
}
}
} else {
// SET
boolean found = false;
for (OStorageEntryConfiguration e : storage.getConfiguration().properties) {
if (e.name.equals(iName)) {
e.value = iValue;
found = true;
break;
}
}
if (!found)
// CREATE A NEW ONE
storage.getConfiguration().properties.add(new OStorageEntryConfiguration(iName, iValue));
}
storage.getConfiguration().update();
}