Package land.oras
Class OCILayout
Index from an OCI layout
-
Nested Class Summary
Nested Classes -
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic OCILayout.Builder
builder()
Return a new builder for this oci layoutFetch blob and return it as input streamvoid
Fetch blob and save it to fileFetch blob and return it's descriptorstatic OCILayout
Create the OCI layout file from a JSON stringstatic OCILayout
fromLayoutIndex
(Path layoutPath) Return the OCI layout from the index.json filebyte[]
Get the blob for the given digest.getDescriptor
(LayoutRef ref) Retrieve a descriptorReturn the image layout versionRetrieve an indexgetManifest
(LayoutRef ref) Retrieve a manifestgetPath()
Return the path to the OCI layoutgetReferrers
(LayoutRef ref, @Nullable ArtifactType artifactType) Get the referrers of a containerGet the tags for a refGet the tags for a refprobeDescriptor
(LayoutRef ref) Probe a descriptor.void
pullArtifact
(LayoutRef ref, Path path, boolean overwrite) Pull an artifactpushArtifact
(LayoutRef ref, ArtifactType artifactType, Annotations annotations, @Nullable Config config, LocalPath... paths) Push an artifactPush the blob for the given layerPush a blob from filePush an indexpushManifest
(LayoutRef layoutRef, Manifest manifest) Push a manifesttoJson()
Return the JSON representation of the referrersMethods inherited from class land.oras.OCI
attachArtifact, attachArtifact, collectLayers, isIndexMediaType, isManifestMediaType, pullConfig, pushArtifact, pushArtifact, pushArtifact, pushBlob, pushBlob, pushConfig, pushLayers
-
Method Details
-
builder
Return a new builder for this oci layout- Returns:
- The builder
-
pushArtifact
public Manifest pushArtifact(LayoutRef ref, ArtifactType artifactType, Annotations annotations, @Nullable Config config, LocalPath... paths) Description copied from class:OCI
Push an artifact- Specified by:
pushArtifact
in classOCI<LayoutRef>
- Parameters:
ref
- The containerartifactType
- The artifact type. Can be nullannotations
- The annotationsconfig
- The configpaths
- The paths- Returns:
- The manifest
-
pullArtifact
Description copied from class:OCI
Pull an artifact- Specified by:
pullArtifact
in classOCI<LayoutRef>
- Parameters:
ref
- The reference of the artifactpath
- The path to save the artifactoverwrite
- Overwrite the artifact if it exists
-
pushManifest
Description copied from class:OCI
Push a manifest- Specified by:
pushManifest
in classOCI<LayoutRef>
- Parameters:
layoutRef
- The refmanifest
- The manifest- Returns:
- The location
-
pushIndex
Description copied from class:OCI
Push an index -
getIndex
Description copied from class:OCI
Retrieve an index -
getManifest
Description copied from class:OCI
Retrieve a manifest- Specified by:
getManifest
in classOCI<LayoutRef>
- Parameters:
ref
- The ref- Returns:
- The manifest
-
getBlob
Description copied from class:OCI
Get the blob for the given digest. Not be suitable for large blobs -
fetchBlob
Description copied from class:OCI
Fetch blob and save it to file -
fetchBlob
Description copied from class:OCI
Fetch blob and return it as input stream -
fetchBlobDescriptor
Description copied from class:OCI
Fetch blob and return it's descriptor- Specified by:
fetchBlobDescriptor
in classOCI<LayoutRef>
- Parameters:
ref
- The ref- Returns:
- The descriptor
-
pushBlob
Description copied from class:OCI
Push a blob from file -
pushBlob
Description copied from class:OCI
Push the blob for the given layer -
getTags
Description copied from class:OCI
Get the tags for a ref -
getRepositories
Description copied from class:OCI
Get the tags for a ref- Specified by:
getRepositories
in classOCI<LayoutRef>
- Returns:
- The repositories
-
getReferrers
Description copied from class:OCI
Get the referrers of a container- Specified by:
getReferrers
in classOCI<LayoutRef>
- Parameters:
ref
- The refartifactType
- The optional artifact type- Returns:
- The referrers
-
toJson
Return the JSON representation of the referrers- Returns:
- The JSON string
-
fromJson
Create the OCI layout file from a JSON string- Parameters:
json
- The JSON string- Returns:
- The OCI layout
-
getImageLayoutVersion
Return the image layout version- Returns:
- The image layout version
-
getDescriptor
Description copied from class:OCI
Retrieve a descriptor- Specified by:
getDescriptor
in classOCI<LayoutRef>
- Parameters:
ref
- The ref- Returns:
- The descriptor
-
probeDescriptor
Description copied from class:OCI
Probe a descriptor. Typically used to get digest, size and media type without the content- Specified by:
probeDescriptor
in classOCI<LayoutRef>
- Parameters:
ref
- The ref- Returns:
- The descriptor
-
fromLayoutIndex
Return the OCI layout from the index.json file- Parameters:
layoutPath
- The path to the layout containing the index.json file- Returns:
- The OCI layout
-
getPath
Return the path to the OCI layout- Returns:
- The path to the OCI layout
-