code: protected function getExtension(ContentfulAsset $asset, $locale)
      {
          $asset   = $this->assetRepo->findNewestById($asset->getSpaceId(), $asset->getId())->getOrCall(function () use ($asset) {
              throw new InvalidArgumentException(
                  sprintf(
                      'Cannot find asset with id "%s" in space "%s"!',
                      $asset->getId(),
                      $asset->getSpaceId()
                  )
              );
          });
          $guesser = ExtensionGuesser::getInstance();
          return $guesser->guess($asset->file[$locale]['contentType']);
      }
docs: @param ContentfulAsset $asset
  @param string          $locale
  
  @return string|null
  @throws InvalidArgumentException