use of org.structr.files.ssh.filesystem.StructrPath.HiddenFileEntry in project structr by structr.
the class StructrPropertyValueChannel method setConvertedPropertyValue.
public static void setConvertedPropertyValue(final SecurityContext securityContext, final GraphObject graphObject, final PropertyKey key, final String value) throws IOException, FrameworkException {
final PropertyConverter converter = key.inputConverter(securityContext);
final String previousUuid = graphObject.getUuid();
Object actualValue = value;
if (converter != null) {
actualValue = converter.convert(actualValue);
}
if (key.isReadOnly()) {
graphObject.unlockReadOnlyPropertiesOnce();
}
if (key.isSystemInternal()) {
graphObject.unlockSystemPropertiesOnce();
}
// set value
graphObject.setProperty(key, actualValue);
// move "hidden" entries to new UUID
if (GraphObject.id.equals(key)) {
final HiddenFileEntry entry = StructrPath.HIDDEN_PROPERTY_FILES.get(previousUuid);
if (entry != null) {
StructrPath.HIDDEN_PROPERTY_FILES.remove(previousUuid);
StructrPath.HIDDEN_PROPERTY_FILES.put(value, entry);
}
}
}
Aggregations