}
@RequestMapping(value = BASE_MAPPING + "/file", method = DELETE)
public ResponseEntity<?> deleteFileOfPropertyOfEntity(RootResourceInformation repoRequest, @BackendId Serializable id, @PathVariable String property) throws Exception {
PersistentEntity<?, ?> persistentEntity = repoRequest.getPersistentEntity();
RepositoryInvoker invoker = repoRequest.getInvoker();
Object domainObj = invoker.invokeFindOne(id);
if (null == domainObj) {
throw new ResourceNotFoundException();
}
PersistentProperty<?> prop = persistentEntity.getPersistentProperty(property);
if (null == prop) {
throw new ResourceNotFoundException();
}
if (!isOfFileType(prop)) {
return toEmptyResponse(METHOD_NOT_ALLOWED);
}
fileResourceStorage().delete(domainObj, prop);
invoker.invokeSave(domainObj);
return toEmptyResponse(OK);
}