java.lang.Object
land.oras.OCI<T>
- Type Parameters:
T
- The reference type
public abstract sealed class OCI<T extends Ref<@NonNull T>>
extends Object
permits Registry, OCILayout
Abstract class for OCI operation on remote registry or layout
Commons methods for OCI operations
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionattachArtifact
(T ref, ArtifactType artifactType, Annotations annotations, LocalPath... paths) Attach file to an existing manifestfinal Manifest
attachArtifact
(T ref, ArtifactType artifactType, LocalPath... paths) Attach an artifactabstract InputStream
Fetch blob and return it as input streamabstract void
Fetch blob and save it to fileabstract Descriptor
fetchBlobDescriptor
(T ref) Fetch blob and return it's descriptorabstract byte[]
Get the blob for the given digest.abstract Descriptor
getDescriptor
(T ref) Retrieve a descriptorabstract Index
Retrieve an indexabstract Manifest
getManifest
(T ref) Retrieve a manifestabstract void
pullArtifact
(T ref, Path path, boolean overwrite) Pull an artifactabstract Manifest
pushArtifact
(T ref, ArtifactType artifactType, Annotations annotations, @Nullable Config config, LocalPath... paths) Push an artifactpushArtifact
(T ref, ArtifactType artifactType, Annotations annotations, LocalPath... paths) Upload an ORAS artifactpushArtifact
(T ref, ArtifactType artifactType, LocalPath... paths) Push an artifactpushArtifact
(T ref, LocalPath... paths) Push an artifactabstract Layer
Push the blob for the given layerpushBlob
(T ref, InputStream input) Push a blob from filePush a blob from fileabstract Layer
Push a blob from filefinal Config
pushConfig
(T ref, Config config) Push configpushLayers
(T ref, boolean withDigest, LocalPath... paths) abstract Manifest
pushManifest
(T ref, Manifest manifest) Push a manifest
-
Field Details
-
LOG
protected static final org.slf4j.Logger LOGThe logger
-
-
Constructor Details
-
OCI
protected OCI()Default constructor
-
-
Method Details
-
pushArtifact
Push an artifact- Parameters:
ref
- The refpaths
- The paths- Returns:
- The manifest
-
pushArtifact
Push an artifact- Parameters:
ref
- The refartifactType
- The artifact typepaths
- The paths- Returns:
- The manifest
-
pushArtifact
public Manifest pushArtifact(T ref, ArtifactType artifactType, Annotations annotations, LocalPath... paths) Upload an ORAS artifact- Parameters:
ref
- The refartifactType
- The artifact typeannotations
- The annotationspaths
- The paths- Returns:
- The manifest
-
pushBlob
Push a blob from file- Parameters:
ref
- The refblob
- The blob- Returns:
- The layer
-
pushBlob
Push a blob from file- Parameters:
ref
- The refinput
- The input stream- Returns:
- The layer
-
pushLayers
-
pushConfig
Push config- Parameters:
ref
- The refconfig
- The config- Returns:
- The config
-
attachArtifact
Attach an artifact- Parameters:
ref
- The refartifactType
- The artifact typepaths
- The paths- Returns:
- The manifest
-
pushArtifact
public abstract Manifest pushArtifact(T ref, ArtifactType artifactType, Annotations annotations, @Nullable Config config, LocalPath... paths) Push an artifact- Parameters:
ref
- The containerartifactType
- The artifact type. Can be nullannotations
- The annotationsconfig
- The configpaths
- The paths- Returns:
- The manifest
-
pullArtifact
Pull an artifact- Parameters:
ref
- The reference of the artifactpath
- The path to save the artifactoverwrite
- Overwrite the artifact if it exists
-
pushManifest
Push a manifest- Parameters:
ref
- The refmanifest
- The manifest- Returns:
- The location
-
getIndex
Retrieve an index- Parameters:
ref
- The ref- Returns:
- The index
-
getManifest
Retrieve a manifest- Parameters:
ref
- The ref- Returns:
- The manifest
-
getDescriptor
Retrieve a descriptor- Parameters:
ref
- The ref- Returns:
- The descriptor
-
getBlob
Get the blob for the given digest. Not be suitable for large blobs- Parameters:
ref
- The ref- Returns:
- The blob as bytes
-
fetchBlob
Fetch blob and save it to file- Parameters:
ref
- The refpath
- The path to save the blob
-
fetchBlob
Fetch blob and return it as input stream- Parameters:
ref
- The ref- Returns:
- The input stream
-
fetchBlobDescriptor
Fetch blob and return it's descriptor- Parameters:
ref
- The ref- Returns:
- The descriptor
-
pushBlob
Push a blob from file- Parameters:
ref
- The containerblob
- The blobannotations
- The annotations- Returns:
- The layer
-
pushBlob
Push the blob for the given layer- Parameters:
ref
- The container refdata
- The data- Returns:
- The layer
-
attachArtifact
public Manifest attachArtifact(T ref, ArtifactType artifactType, Annotations annotations, LocalPath... paths) Attach file to an existing manifest- Parameters:
ref
- The refartifactType
- The artifact typeannotations
- The annotationspaths
- The paths- Returns:
- The manifest of the new artifact
-