public interface ArtifactPathBuilder
StorageLocationService
.
An artifact path can have two formats, a plan-oriented format and a global format. The plan-oriented format groups artifacts by the plans that produced them. The global format is independent of the plan. The global format may be used when an artifact needs to survive longer than the plan that created it.
The plan oriented format looks like this:
[artifact-root] / [chain-storage-tag] / [job-part] / [build-part] / [label-part]
Where:
Here are some examples of plan-oriented paths:
PROJA-PLAN1/JOB14/build-00035/my-non-shared-artifact PROJA-PLAN1/shared/build-00035/my-shared-artifact plan-61257948/JOB14/build-00035/my-non-shared-artifact plan-61257948/shared/build-00035/my-shared-artifact
The global format looks like this:
[artifact-root] / globalStorage / [artifact-id]
Where [artifact-id] is the plain database id of the artifact.
for example:
globalStorage/5898243
Modifier and Type | Method and Description |
---|---|
String |
getArtifactPath(Artifact artifact)
Returns a plan-oriented or global storage path for the supplied artifact, based on the return value
of artifact.isGloballyStored().
|
String |
getBuildPath(PlanResultKey planResultKey)
Returns [artifact-root] / [chain-storage-tag] / [job-part] / [build-part]
[job-part] will be "shared" if the parameter points to a chain rather than a job.
|
String |
getChainPath(PlanKey planKey)
Returns [artifact-root] / [chain-storage-tag]
|
String |
getEntityOrientedArtifactPath(ResultKey resultKey,
ImmutableArtifactDefinitionBase artifactDefinition)
Always returns a entity-oriented path, never a global storage path.
|
String |
getJobOrSharedPath(PlanKey planKey)
Returns [artifact-root] / [chain-storage-tag] / [job-part]
[job-part] will be "shared" if the parameter points to a chain rather than a job.
|
String |
getPlanOrientedArtifactPath(PlanResultKey planResultKey,
ImmutableArtifactDefinitionBase artifactDefinition)
Always returns a plan-oriented path, never a global storage path.
|
String |
getRootPath()
Returns the root artifact storage path that this instance is using to build absolute paths, or null if this
instance is configured to build relative paths.
|
String |
getTemporaryPath()
Returns a path that can be used for temporary storage underneath the artifact root storage path.
|
String getRootPath()
String getTemporaryPath()
String getArtifactPath(Artifact artifact)
String getPlanOrientedArtifactPath(PlanResultKey planResultKey, @Nullable ImmutableArtifactDefinitionBase artifactDefinition)
String getEntityOrientedArtifactPath(ResultKey resultKey, @Nullable ImmutableArtifactDefinitionBase artifactDefinition)
String getJobOrSharedPath(PlanKey planKey)
String getBuildPath(PlanResultKey planResultKey)
Copyright © 2021 Atlassian Software Systems Pty Ltd. All rights reserved.