if (document == null) { throw new DocumentNotFoundException(documentCommand.getParentEntityType(),
documentCommand.getParentEntityId(), documentCommand.getId()); }
this.documentRepository.delete(document);
final ContentRepository contentRepository = this.contentRepositoryFactory.getRepository(document.storageType());
contentRepository.deleteFile(document.getName(), document.getLocation());
return new CommandProcessingResult(document.getId());
}
private void validateParentEntityType(final DocumentCommand documentCommand) {
if (!checkValidEntityType(documentCommand.getParentEntityType())) { throw new InvalidEntityTypeForDocumentManagementException(