class ConanContentValidator implements ContentValidator {

  @Nonnull
  @Override
  public String determineContentType(final boolean strictContentTypeValidation,
                                     final Supplier<InputStream> contentSupplier,
                                     @Nullable final MimeRulesSource mimeRulesSource,
                                     @Nullable final String contentName,
                                     @Nullable final String declaredContentType) throws IOException
  {
    if (contentName != null) {
      if (contentName.endsWith(".tgz")) {
        return ContentTypes.APPLICATION_GZIP;
      }
      else if (contentName.endsWith("/conanfile.py")) {
        return X_PYTHON;
      }
      else if (ConanFacetUtils.isPackageSnapshot(contentName)) {
        return ContentTypes.APPLICATION_JSON;
      }
      else if (ConanFacetUtils.isDigest(contentName)) {
        return ContentTypes.APPLICATION_JSON;
      }
    }
    return defaultContentValidator.determineContentType(
        strictContentTypeValidation, contentSupplier, mimeRulesSource, contentName, declaredContentType
    );
  }

  @Inject public  ConanContentValidator(final DefaultContentValidator defaultContentValidator);

}