Package land.oras
Class OCILayout
Index from an OCI layout
-
Nested Class Summary
Nested Classes -
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic OCILayout.Builderbuilder()Return a new builder for this oci layoutbooleanReturn whether this OCI instance supports mounting blobs from the given source OCI instance.Fetch blob and return it as input streamvoidFetch blob and save it to fileFetch blob and return it's descriptorstatic OCILayoutCreate the OCI layout file from a JSON stringstatic OCILayoutfromLayoutIndex(Path layoutPath) Return the OCI layout from the index.json filebyte[]Get the blob for the given digest.getDescriptor(LayoutRef ref) Retrieve a descriptorGet the executor service for concurrent operations.Return 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 refGet the tags for a refbooleanMount a blob from another repository in the same OCI target.probeDescriptor(LayoutRef ref) Probe a descriptor.voidpullArtifact(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 input stream with known digest and sizePush 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, pushLayer, pushLayers
-
Method Details
-
canMount
Description copied from class:OCIReturn whether this OCI instance supports mounting blobs from the given source OCI instance. -
mountBlob
Description copied from class:OCIMount a blob from another repository in the same OCI target. -
builder
Return a new builder for this oci layout- Returns:
- The builder
-
getExecutorService
Description copied from class:OCIGet the executor service for concurrent operations. This is used for concurrent pushing and pulling of layers.- Specified by:
getExecutorServicein classOCI<LayoutRef>- Returns:
- The executor service
-
pushArtifact
public Manifest pushArtifact(LayoutRef ref, ArtifactType artifactType, Annotations annotations, @Nullable Config config, LocalPath... paths) Description copied from class:OCIPush an artifact- Specified by:
pushArtifactin 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:OCIPull an artifact- Specified by:
pullArtifactin 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:OCIPush a manifest- Specified by:
pushManifestin classOCI<LayoutRef>- Parameters:
layoutRef- The refmanifest- The manifest- Returns:
- The location
-
pushIndex
Description copied from class:OCIPush an index -
getIndex
Description copied from class:OCIRetrieve an index -
getManifest
Description copied from class:OCIRetrieve a manifest- Specified by:
getManifestin classOCI<LayoutRef>- Parameters:
ref- The ref- Returns:
- The manifest
-
getBlob
Description copied from class:OCIGet the blob for the given digest. Not be suitable for large blobs -
fetchBlob
Description copied from class:OCIFetch blob and save it to file -
fetchBlob
Description copied from class:OCIFetch blob and return it as input stream -
fetchBlobDescriptor
Description copied from class:OCIFetch blob and return it's descriptor- Specified by:
fetchBlobDescriptorin classOCI<LayoutRef>- Parameters:
ref- The ref- Returns:
- The descriptor
-
pushBlob
Description copied from class:OCIPush a blob from file -
pushBlob
public Layer pushBlob(LayoutRef ref, long size, Supplier<InputStream> stream, Map<String, String> annotations) Description copied from class:OCIPush a blob from input stream with known digest and size -
pushBlob
Description copied from class:OCIPush the blob for the given layer -
getTags
Description copied from class:OCIGet the tags for a ref -
getTags
Description copied from class:OCIGet the tags for a ref -
getRepositories
Description copied from class:OCIGet the tags for a ref- Specified by:
getRepositoriesin classOCI<LayoutRef>- Returns:
- The repositories
-
getReferrers
Description copied from class:OCIGet the referrers of a container- Specified by:
getReferrersin 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:OCIRetrieve a descriptor- Specified by:
getDescriptorin classOCI<LayoutRef>- Parameters:
ref- The ref- Returns:
- The descriptor
-
probeDescriptor
Description copied from class:OCIProbe a descriptor. Typically used to get digest, size and media type without the content- Specified by:
probeDescriptorin 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
-