public CommandProcessingResult updateDocument(final DocumentCommand documentCommand, final InputStream inputStream) {
try {
this.context.authenticatedUser();
String oldLocation = null;
final DocumentCommandValidator validator = new DocumentCommandValidator(documentCommand);
validator.validateForUpdate();
// TODO check if entity id is valid and within data scope for the
// user
final Document documentForUpdate = this.documentRepository.findOne(documentCommand.getId());
if (documentForUpdate == null) { throw new DocumentNotFoundException(documentCommand.getParentEntityType(),
documentCommand.getParentEntityId(), documentCommand.getId()); }