Package land.oras

Class Registry


@NullMarked public final class Registry extends OCI<ContainerRef>
A registry is the main entry point for interacting with a container registry
  • Method Details

    • builder

      public static Registry.Builder builder()
      Return a new builder for this registry
      Returns:
      The builder
    • getScheme

      public String getScheme()
      Get the HTTP scheme depending on the insecure flag
      Returns:
      The scheme
    • getRegistry

      public @Nullable String getRegistry()
      Get the registry URL
      Returns:
      The registry URL
    • getTags

      public Tags getTags(ContainerRef containerRef)
      Description copied from class: OCI
      Get the tags for a ref
      Specified by:
      getTags in class OCI<ContainerRef>
      Parameters:
      containerRef - The ref
      Returns:
      The tags
    • getRepositories

      public Repositories getRepositories()
      Description copied from class: OCI
      Get the tags for a ref
      Specified by:
      getRepositories in class OCI<ContainerRef>
      Returns:
      The repositories
    • getReferrers

      public Referrers getReferrers(ContainerRef containerRef, @Nullable ArtifactType artifactType)
      Description copied from class: OCI
      Get the referrers of a container
      Specified by:
      getReferrers in class OCI<ContainerRef>
      Parameters:
      containerRef - The ref
      artifactType - The optional artifact type
      Returns:
      The referrers
    • deleteManifest

      public void deleteManifest(ContainerRef containerRef)
      Delete a manifest
      Parameters:
      containerRef - The artifact
    • pushManifest

      public Manifest pushManifest(ContainerRef containerRef, Manifest manifest)
      Description copied from class: OCI
      Push a manifest
      Specified by:
      pushManifest in class OCI<ContainerRef>
      Parameters:
      containerRef - The ref
      manifest - The manifest
      Returns:
      The location
    • pushIndex

      public Index pushIndex(ContainerRef containerRef, Index index)
      Description copied from class: OCI
      Push an index
      Specified by:
      pushIndex in class OCI<ContainerRef>
      Parameters:
      containerRef - The ref
      index - The index
      Returns:
      The index
    • deleteBlob

      public void deleteBlob(ContainerRef containerRef)
      Delete a blob
      Parameters:
      containerRef - The container
    • pullArtifact

      public void pullArtifact(ContainerRef containerRef, Path path, boolean overwrite)
      Description copied from class: OCI
      Pull an artifact
      Specified by:
      pullArtifact in class OCI<ContainerRef>
      Parameters:
      containerRef - The reference of the artifact
      path - The path to save the artifact
      overwrite - Overwrite the artifact if it exists
    • pushArtifact

      public Manifest pushArtifact(ContainerRef containerRef, ArtifactType artifactType, Annotations annotations, @Nullable Config config, LocalPath... paths)
      Description copied from class: OCI
      Push an artifact
      Specified by:
      pushArtifact in class OCI<ContainerRef>
      Parameters:
      containerRef - The container
      artifactType - The artifact type. Can be null
      annotations - The annotations
      config - The config
      paths - The paths
      Returns:
      The manifest
    • pushBlob

      public Layer pushBlob(ContainerRef containerRef, Path blob, Map<String,String> annotations)
      Description copied from class: OCI
      Push a blob from file
      Specified by:
      pushBlob in class OCI<ContainerRef>
      Parameters:
      containerRef - The container
      blob - The blob
      annotations - The annotations
      Returns:
      The layer
    • pushBlob

      public Layer pushBlob(ContainerRef containerRef, byte[] data)
      Description copied from class: OCI
      Push the blob for the given layer
      Specified by:
      pushBlob in class OCI<ContainerRef>
      Parameters:
      containerRef - The container ref
      data - The data
      Returns:
      The layer
    • getBlob

      public byte[] getBlob(ContainerRef containerRef)
      Get the blob for the given digest. Not be suitable for large blobs
      Specified by:
      getBlob in class OCI<ContainerRef>
      Parameters:
      containerRef - The container
      Returns:
      The blob as bytes
    • fetchBlob

      public void fetchBlob(ContainerRef containerRef, Path path)
      Description copied from class: OCI
      Fetch blob and save it to file
      Specified by:
      fetchBlob in class OCI<ContainerRef>
      Parameters:
      containerRef - The ref
      path - The path to save the blob
    • fetchBlob

      public InputStream fetchBlob(ContainerRef containerRef)
      Description copied from class: OCI
      Fetch blob and return it as input stream
      Specified by:
      fetchBlob in class OCI<ContainerRef>
      Parameters:
      containerRef - The ref
      Returns:
      The input stream
    • fetchBlobDescriptor

      public Descriptor fetchBlobDescriptor(ContainerRef containerRef)
      Description copied from class: OCI
      Fetch blob and return it's descriptor
      Specified by:
      fetchBlobDescriptor in class OCI<ContainerRef>
      Parameters:
      containerRef - The ref
      Returns:
      The descriptor
    • getManifest

      public Manifest getManifest(ContainerRef containerRef)
      Description copied from class: OCI
      Retrieve a manifest
      Specified by:
      getManifest in class OCI<ContainerRef>
      Parameters:
      containerRef - The ref
      Returns:
      The manifest
    • getIndex

      public Index getIndex(ContainerRef containerRef)
      Description copied from class: OCI
      Retrieve an index
      Specified by:
      getIndex in class OCI<ContainerRef>
      Parameters:
      containerRef - The ref
      Returns:
      The index
    • getDescriptor

      public Descriptor getDescriptor(ContainerRef containerRef)
      Description copied from class: OCI
      Retrieve a descriptor
      Specified by:
      getDescriptor in class OCI<ContainerRef>
      Parameters:
      containerRef - The ref
      Returns:
      The descriptor
    • probeDescriptor

      public Descriptor probeDescriptor(ContainerRef ref)
      Description copied from class: OCI
      Probe a descriptor. Typically used to get digest, size and media type without the content
      Specified by:
      probeDescriptor in class OCI<ContainerRef>
      Parameters:
      ref - The ref
      Returns:
      The descriptor
    • getBlobStream

      public InputStream getBlobStream(ContainerRef containerRef)
      Get blob as stream to avoid loading into memory
      Parameters:
      containerRef - The container ref
      Returns:
      The input stream