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

    • getScheme

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

      public List<String> getTags(ContainerRef containerRef)
      Get the tags of a container
      Parameters:
      containerRef - The container
      Returns:
      The tags
    • getReferrers

      public Referrers getReferrers(ContainerRef containerRef, @Nullable ArtifactType artifactType)
      Get the referrers of a container
      Parameters:
      containerRef - The container
      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)
      Push a manifest
      Parameters:
      containerRef - The container
      index - The index
      Returns:
      The location
    • 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
    • copy

      public void copy(Registry targetRegistry, ContainerRef sourceContainer, ContainerRef targetContainer)
      Copy an artifact from one container to another
      Parameters:
      targetRegistry - The target registry
      sourceContainer - The source container
      targetContainer - The target container
    • 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
    • getBlobStream

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