Search in sources :

Example 1 with BlobPayload

use of org.sonatype.nexus.repository.view.payloads.BlobPayload in project nexus-repository-r by sonatype-nexus-community.

the class RFacetUtils method toContent.

/**
 * Convert an asset blob to {@link Content}.
 *
 * @return content of asset blob
 */
static Content toContent(final Asset asset, final Blob blob) {
    Content content = new Content(new BlobPayload(blob, asset.requireContentType()));
    Content.extractFromAsset(asset, HASH_ALGORITHMS, content.getAttributes());
    return content;
}
Also used : BlobPayload(org.sonatype.nexus.repository.view.payloads.BlobPayload) Content(org.sonatype.nexus.repository.view.Content)

Example 2 with BlobPayload

use of org.sonatype.nexus.repository.view.payloads.BlobPayload in project nexus-repository-r by sonatype-nexus-community.

the class RFacetUtils method toContent.

/**
 * Convert an asset blob to {@link Content}.
 *
 * @return content of asset blob
 */
public static Content toContent(final Asset asset, final Blob blob) {
    Content content = new Content(new BlobPayload(blob, asset.requireContentType()));
    Content.extractFromAsset(asset, HASH_ALGORITHMS, content.getAttributes());
    return content;
}
Also used : BlobPayload(org.sonatype.nexus.repository.view.payloads.BlobPayload) Content(org.sonatype.nexus.repository.view.Content)

Aggregations

Content (org.sonatype.nexus.repository.view.Content)2 BlobPayload (org.sonatype.nexus.repository.view.payloads.BlobPayload)2