return toEmptyResponse(METHOD_NOT_ALLOWED);
}
private FilePropertyValue evaluateFilePropertyValue(Object instance, PersistentProperty persistentProperty) {
FileResourceStorage fileResourceStorage = fileResourceStorage();
try {
if (!fileResourceStorage.fileExists(instance, persistentProperty)) {
return new FilePropertyValue(false);
}
Link fileLink = entityLinks().linkForFilePropertyLink(instance, persistentProperty);
byte[] fileData = fileResourceStorage.load(instance, persistentProperty);
return new FilePropertyValue(fileLink, fileData);
} catch (Exception e) {
throw new ResourceNotFoundException(e.getMessage());