Package land.oras
Class Layer
java.lang.Object
land.oras.Descriptor
land.oras.Layer
Class for layer
-
Field Summary
Fields inherited from class land.oras.Descriptor
annotations, artifactType, digest, json, mediaType, size
-
Method Summary
Modifier and TypeMethodDescriptionstatic Layer
empty()
An empty configstatic Layer
fromData
(ContainerRef containerRef, byte[] data) Create a layer from datastatic Layer
fromDigest
(String digest, long size) Create a layer from a digeststatic Layer
Create a layer from a file using default digeststatic Layer
fromFile
(Path file, SupportedAlgorithm algorithm) Create a layer from a file using a specific algorithmstatic Layer
Create a layer from a JSON string@Nullable Path
Get the blob path@Nullable String
getData()
Get the databyte[]
Get the data as byteswithAnnotations
(Map<String, String> annotations) Create a new layer with annotationswithMediaType
(String mediaType) Create a new layer with media typeMethods inherited from class land.oras.Descriptor
getAnnotations, getArtifactType, getDigest, getJson, getMediaType, getSize, of, of, of, toJson, toSubject, withJson
-
Method Details
-
getData
Get the data- Returns:
- The data
-
getBlobPath
Get the blob path- Returns:
- The blob path
-
withAnnotations
Create a new layer with annotations- Parameters:
annotations
- The annotations- Returns:
- The new layer
-
withMediaType
Create a new layer with media type- Parameters:
mediaType
- The media type- Returns:
- The new layer
-
getDataBytes
public byte[] getDataBytes()Get the data as bytes- Returns:
- The data as bytes
-
fromJson
Create a layer from a JSON string- Parameters:
json
- The JSON string- Returns:
- The manifest
-
fromFile
Create a layer from a file using default digest- Parameters:
file
- The file- Returns:
- The layer
-
fromFile
Create a layer from a file using a specific algorithm- Parameters:
file
- The filealgorithm
- The algorithm- Returns:
- The layer
-
fromData
Create a layer from data- Parameters:
containerRef
- The container referencedata
- The data- Returns:
- The layer
-
fromDigest
Create a layer from a digest- Parameters:
digest
- The digestsize
- The size- Returns:
- The layer
-
empty
An empty config- Returns:
- The empty config
-