WritableContentRepository contentRepository = (WritableContentRepository) getContentRepository(site, true);
// Delete the resource
try {
resource = contentRepository.deleteContent(uri, content);
resource.setModified(user, new Date());
// TODO: Remove existing preview images
contentRepository.put(resource);
} catch (IllegalStateException e) {
logger.warn("Tried to remove content from missing resource " + uri);