Class ArtifactStoreURISHA256Builder
- java.lang.Object
-
- com.netflix.spinnaker.kork.artifacts.artifactstore.ArtifactStoreURIBuilder
-
- com.netflix.spinnaker.kork.artifacts.artifactstore.ArtifactStoreURISHA256Builder
-
public class ArtifactStoreURISHA256Builder extends ArtifactStoreURIBuilder
Helper class to abstract away the need for other classes to know the {@link * #uriPrefix} format.
-
-
Field Summary
-
Fields inherited from class com.netflix.spinnaker.kork.artifacts.artifactstore.ArtifactStoreURIBuilder
uriScheme
-
-
Constructor Summary
Constructors Constructor Description ArtifactStoreURISHA256Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ArtifactReferenceURIbuildArtifactURI(java.lang.String context, Artifact artifact)Returns the remote artifact URI that will be associated with some artifact.ArtifactReferenceURIbuildURIFromPaths(java.lang.String context, java.lang.String... paths)buildRawURI is used when you have the raw path and context.
-
-
-
Method Detail
-
buildArtifactURI
public ArtifactReferenceURI buildArtifactURI(java.lang.String context, Artifact artifact)
Description copied from class:ArtifactStoreURIBuilderReturns the remote artifact URI that will be associated with some artifact.- Specified by:
buildArtifactURIin classArtifactStoreURIBuilder- Parameters:
context- is the context in which this artifact was run in, e.g. the application.artifact- that will be associated with the generated URI.- Returns:
- the remote URI
-
buildURIFromPaths
public ArtifactReferenceURI buildURIFromPaths(java.lang.String context, java.lang.String... paths)
Description copied from class:ArtifactStoreURIBuilderbuildRawURI is used when you have the raw path and context. This method just simply returns the properly formatted URI using the URI builder that extends this class.This function is primarily used in clouddriver when deck is asking for the raw artifact to be displayed. Since we don't have the artifact, but only the context and some raw ID from the gate endpoint,
/context/hash
we need to reconstruct the full remote URI in clouddriver.
String application = "my-spinnaker-application"; String artifactSHA256 = "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"; ArtifactStoreURIBuilder uriBuilder = new ArtifactStoreURISHA256Builder(); // returns ref://my-spinnaker-application/e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 String uriString = uriBuilder.buildRawURI(application, artifactSHA256);- Specified by:
buildURIFromPathsin classArtifactStoreURIBuilder- Parameters:
context- is the context in which this artifact was run in, e.g. the application.paths- are any individual path required for distinguishing an artifact.- Returns:
- a properly formatted artifact store URI
-
-