Class ResourceDescriptor
java.lang.Object
org.apache.commons.release.plugin.slsa.v1_2.ResourceDescriptor
Description of an artifact or resource referenced in the build, identified by URI and cryptographic digest.
Used to represent inputs to, outputs from, or byproducts of the build process.
- Since:
- 1.10.0
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new ResourceDescriptor instance.ResourceDescriptor(String uri, Map<String, String> digest) Creates a new ResourceDescriptor with the given URI and digest. -
Method Summary
Modifier and TypeMethodDescriptionbooleanGets additional key-value metadata about the resource, such as filename, size, or builder-specific attributes.byte[]Gets the raw contents of the resource, base64-encoded when serialized to JSON.Gets the map of cryptographic digest algorithms to their corresponding hex-encoded values for this resource.Gets the download URI for the resource, if different fromgetUri().Gets the media type of the resource (for example,"application/octet-stream").getName()Gets the name of the resource.getUri()Gets the URI identifying the resource.inthashCode()setAnnotations(Map<String, Object> annotations) Sets additional key-value metadata about the resource.setContent(byte[] content) Sets the raw contents of the resource.Sets the map of cryptographic digest algorithms to their hex-encoded values.setDownloadLocation(String downloadLocation) Sets the download URI for the resource.setMediaType(String mediaType) Sets the media type of the resource.Sets the name of the resource.Sets the URI identifying the resource.toString()
-
Constructor Details
-
ResourceDescriptor
public ResourceDescriptor()Creates a new ResourceDescriptor instance. -
ResourceDescriptor
Creates a new ResourceDescriptor with the given URI and digest.- Parameters:
uri- URI identifying the resource.digest- map of digest algorithm names to their hex-encoded values.
-
-
Method Details
-
equals
-
getAnnotations
Gets additional key-value metadata about the resource, such as filename, size, or builder-specific attributes.- Returns:
- The annotations map, or
nullif not set.
-
getContent
Gets the raw contents of the resource, base64-encoded when serialized to JSON.- Returns:
- The resource content, or
nullif not set.
-
getDigest
-
getDownloadLocation
Gets the download URI for the resource, if different fromgetUri().- Returns:
- The download location URI, or
nullif not set.
-
getMediaType
Gets the media type of the resource (for example,"application/octet-stream").- Returns:
- The media type, or
nullif not set.
-
getName
-
getUri
-
hashCode
-
setAnnotations
Sets additional key-value metadata about the resource.- Parameters:
annotations- The annotations map.- Returns:
- this for chaining.
-
setContent
Sets the raw contents of the resource.- Parameters:
content- The resource content.- Returns:
- this for chaining.
-
setDigest
Sets the map of cryptographic digest algorithms to their hex-encoded values.- Parameters:
digest- The digest map.- Returns:
- this for chaining.
-
setDownloadLocation
Sets the download URI for the resource.- Parameters:
downloadLocation- The download location URI.- Returns:
- this for chaining.
-
setMediaType
Sets the media type of the resource.- Parameters:
mediaType- The media type.- Returns:
- this for chaining.
-
setName
Sets the name of the resource.- Parameters:
name- The resource name.- Returns:
- this for chaining.
-
setUri
Sets the URI identifying the resource.- Parameters:
uri- The resource URI.- Returns:
- this for chaining.
-
toString
-