congrats Icon
New! Announcing our next generation AI code completions
Read here
Tabnine Logo
Content.extractFromAsset
Code IndexAdd Tabnine to your IDE (free)

How to use
extractFromAsset
method
in
org.sonatype.nexus.repository.view.Content

Best Java code snippets using org.sonatype.nexus.repository.view.Content.extractFromAsset (Showing top 8 results out of 315)

origin: org.sonatype.nexus.plugins/nexus-repository-npm

/**
 * Convert an asset blob to {@link Content}.
 *
 * @return content of asset blob
 */
@Nonnull
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;
}
origin: org.sonatype.nexus.plugins/nexus-repository-raw

 private Content toContent(final Asset asset, final Blob blob) {
  final Content content = new Content(new BlobPayload(blob, asset.requireContentType()));
  Content.extractFromAsset(asset, hashAlgorithms, content.getAttributes());
  return content;
 }
}
origin: org.sonatype.nexus.plugins/nexus-repository-npm

/**
 * Creates a {@link Content} out of passed in package metadata.
 */
@Nonnull
static Content toContent(final Asset packageRootAsset, final NestedAttributesMap packageRoot) {
 Content content = new Content(new BytesPayload(NpmJsonUtils.bytes(packageRoot), ContentTypes.APPLICATION_JSON));
 Content.extractFromAsset(packageRootAsset, HASH_ALGORITHMS, content.getAttributes());
 content.getAttributes().set(NestedAttributesMap.class, packageRoot);
 return content;
}
origin: org.sonatype.nexus.plugins/nexus-repository-maven

private Content toContent(final Asset asset, final Blob blob) {
 final String contentType = asset.contentType();
 final Content content = new Content(new BlobPayload(blob, contentType));
 Content.extractFromAsset(asset, HashType.ALGORITHMS, content.getAttributes());
 return content;
}
origin: sonatype-nexus-community/nexus-repository-helm

 /**
  * Convert an asset blob to {@link Content}.
  *
  * @return content of asset blob
  */
 public 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;
 }
}
origin: sonatype-nexus-community/nexus-repository-apt

public static Content toContent(final Asset asset, final Blob blob) {
 final Content content = new Content(new BlobPayload(blob, asset.requireContentType()));
 Content.extractFromAsset(asset, hashAlgorithms, content.getAttributes());
 return content;
}
origin: sonatype-nexus-community/nexus-repository-composer

 private Content toContent(final Asset asset, final Blob blob) {
  final Content content = new Content(new BlobPayload(blob, asset.requireContentType()));
  Content.extractFromAsset(asset, hashAlgorithms, content.getAttributes());
  return content;
 }
}
origin: org.sonatype.nexus.plugins/nexus-repository-npm

/**
 * Returns the tarball content.
 */
@Nullable
static Content getTarballContent(final StorageTx tx,
                 final Bucket bucket,
                 final NpmPackageId packageId,
                 final String tarballName)
{
 Asset asset = findTarballAsset(tx, bucket, packageId, tarballName);
 if (asset == null) {
  return null;
 }
 Blob blob = tx.requireBlob(asset.requireBlobRef());
 Content content = new Content(new BlobPayload(blob, asset.requireContentType()));
 Content.extractFromAsset(asset, HASH_ALGORITHMS, content.getAttributes());
 return content;
}
org.sonatype.nexus.repository.viewContentextractFromAsset

Javadoc

Extracts non-format specific content attributes into the passed in AttributesMap (usually originating from Content#getAttributes()) from passed in Asset and format required hashes.

Popular methods of Content

  • <init>
  • getAttributes
  • applyToAsset
    Applies non-format specific content attributes onto passed in Asset from passed in AttributesMap(usu
  • findAsset
    Finds fresh Asset instance from passed in TX by entity ID of the Asset used to create passed in Cont
  • maintainLastModified
    Maintains the "last modified" attribute of the content by setting it to "now". It accepts nulls, and
  • openInputStream
  • getContentType
  • close
  • getSize

Popular in Java

  • Running tasks concurrently on multiple threads
  • scheduleAtFixedRate (ScheduledExecutorService)
  • notifyDataSetChanged (ArrayAdapter)
  • putExtra (Intent)
  • RandomAccessFile (java.io)
    Allows reading from and writing to a file in a random-access manner. This is different from the uni-
  • Collection (java.util)
    Collection is the root of the collection hierarchy. It defines operations on data collections and t
  • HashMap (java.util)
    HashMap is an implementation of Map. All optional operations are supported.All elements are permitte
  • Stack (java.util)
    Stack is a Last-In/First-Out(LIFO) data structure which represents a stack of objects. It enables u
  • Executors (java.util.concurrent)
    Factory and utility methods for Executor, ExecutorService, ScheduledExecutorService, ThreadFactory,
  • Base64 (org.apache.commons.codec.binary)
    Provides Base64 encoding and decoding as defined by RFC 2045.This class implements section 6.8. Base
  • Top 15 Vim Plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now