class OrientNpmGroupDataFacet extends FacetSupport {

  protected InputStream buildMergedPackageRootOnMissingBlob(final Map<Repository, Response> responses,
                                                            final Context context,
                                                            final MissingAssetBlobException e) throws IOException
  {
    if (log.isTraceEnabled()) {
      log.info("Missing blob {} containing cached metadata {}, deleting asset and triggering rebuild.",
          e.getBlobRef(), e.getAsset(), e);
    }
    else {
      log.info("Missing blob {} containing cached metadata {}, deleting asset and triggering rebuild.",
          e.getBlobRef(), e.getAsset().name());
    }

    cleanupPackageRootAssetOnlyFromCache(e.getAsset());

    Content content = buildMergedPackageRoot(responses, context);
    // it should never be null, but we are being kind and return an error stream.
    return nonNull(content) ? content.openInputStream() :
        errorInputStream("Unable to retrieve merged package root on recovery for missing blob");
  }

  @Inject public  OrientNpmGroupDataFacet(
      @Named("${nexus.npm.mergeGroupMetadata:-true}") final boolean mergeMetadata);

}