in src/main/java/org/apache/sling/servlets/post/impl/operations/ModifyOperation.java [304:340]
private void processDeletes(final ResourceResolver resolver,
final Map<String, RequestProperty> reqProperties,
final List<Modification> changes,
final VersioningConfiguration versioningConfiguration)
throws PersistenceException {
for (final RequestProperty property : reqProperties.values()) {
if (property.isDelete()) {
final Resource parent = resolver.getResource(property.getParentPath());
if ( parent == null ) {
continue;
}
this.jcrSupport.checkoutIfNecessary(parent, changes, versioningConfiguration);
final ValueMap vm = parent.adaptTo(ModifiableValueMap.class);
if ( vm == null ) {
throw new PersistenceException("Resource '" + parent.getPath() + "' is not modifiable.");
}
if ( vm.containsKey(property.getName()) ) {
if ( JcrConstants.JCR_MIXINTYPES.equals(property.getName()) ) {
vm.put(JcrConstants.JCR_MIXINTYPES, new String[0]);
} else {
vm.remove(property.getName());
}
} else {
final Resource childRsrc = resolver.getResource(parent.getPath() + '/' + property.getName());
if ( childRsrc != null ) {
resolver.delete(childRsrc);
}
}
changes.add(Modification.onDeleted(property.getPath()));
}
}
}