final ContentRepository contentRepository = this.contentRepositoryFactory.getRepository();
documentCommand.setLocation(contentRepository.saveFile(inputStream, documentCommand));
documentCommand.setStorageType(contentRepository.getStorageType().getValue());
}
documentForUpdate.update(documentCommand);
if (inputStream != null && documentCommand.isFileNameChanged()) {
final ContentRepository contentRepository = this.contentRepositoryFactory.getRepository(documentStoreType);
contentRepository.deleteFile(documentCommand.getName(), oldLocation);
}