Class ArtifactPathBuilderImpl
java.lang.Object
com.atlassian.bamboo.storage.location.ArtifactPathBuilderImpl
- All Implemented Interfaces:
ArtifactPathBuilder
- Direct Known Subclasses:
ArtifactPathBuilderFactoryImpl.ArtifactPathBuilderForTemporaryStorage
-
Constructor Summary
ConstructorDescriptionArtifactPathBuilderImpl
(char separatorChar) Constructor for building relative paths.ArtifactPathBuilderImpl
(String rootPath, char separatorChar) Constructor for building absolute paths.ArtifactPathBuilderImpl
(String rootPath, char separatorChar, StorageTagService storageTagService) -
Method Summary
Modifier and TypeMethodDescriptionprotected String
getArtifactDefinitionLabel
(@Nullable ImmutableArtifactDefinitionBase artifactDefinition) getArtifactPath
(Artifact artifact) Returns a plan-oriented or global storage path for the supplied artifact, based on the return value of artifact.isGloballyStored().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.getChainPath
(PlanKey planKey) Returns [artifact-root] / [chain-storage-tag]getEntityOrientedArtifactPath
(ResultKey resultKey, @Nullable ImmutableArtifactDefinitionBase artifactDefinition) Always returns a entity-oriented path, never a global storage path.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.getPlanOrientedArtifactPath
(PlanResultKey planResultKey, @Nullable ImmutableArtifactDefinitionBase artifactDefinition) Always returns a plan-oriented path, never a global storage path.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.Returns a path that can be used for temporary storage underneath the artifact root storage path.
-
Constructor Details
-
ArtifactPathBuilderImpl
Constructor for building absolute paths. All returned paths will be prefixed with the specified rootPath, which is the artifact root storage path. If rootPath is null then all paths will be relative and unprefixed. The instance created by this constructor must be further initialised by autowiring Spring dependencies. -
ArtifactPathBuilderImpl
@TestOnly public ArtifactPathBuilderImpl(String rootPath, char separatorChar, StorageTagService storageTagService) -
ArtifactPathBuilderImpl
public ArtifactPathBuilderImpl(char separatorChar) Constructor for building relative paths. All returned paths will be relative to an unknown root storage path. The instance created by this constructor must be further initialised by autowiring Spring dependencies.
-
-
Method Details
-
getRootPath
Description copied from interface:ArtifactPathBuilder
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.- Specified by:
getRootPath
in interfaceArtifactPathBuilder
-
getTemporaryPath
Description copied from interface:ArtifactPathBuilder
Returns a path that can be used for temporary storage underneath the artifact root storage path.- Specified by:
getTemporaryPath
in interfaceArtifactPathBuilder
-
getArtifactPath
Description copied from interface:ArtifactPathBuilder
Returns a plan-oriented or global storage path for the supplied artifact, based on the return value of artifact.isGloballyStored().- Specified by:
getArtifactPath
in interfaceArtifactPathBuilder
-
getArtifactDefinitionLabel
protected String getArtifactDefinitionLabel(@Nullable @Nullable ImmutableArtifactDefinitionBase artifactDefinition) -
getPlanOrientedArtifactPath
public String getPlanOrientedArtifactPath(PlanResultKey planResultKey, @Nullable @Nullable ImmutableArtifactDefinitionBase artifactDefinition) Description copied from interface:ArtifactPathBuilder
Always returns a plan-oriented path, never a global storage path. ie. returns [artifact-root] / [chain-storage-tag] / [job-part] / [build-part] / [label-part] [job-part] will be "shared" if the artifact is shared or if planResultKey points to a chain rather than a job. [label-part] will be omitted if artifactDefinition is null.- Specified by:
getPlanOrientedArtifactPath
in interfaceArtifactPathBuilder
-
getEntityOrientedArtifactPath
public String getEntityOrientedArtifactPath(ResultKey resultKey, @Nullable @Nullable ImmutableArtifactDefinitionBase artifactDefinition) Description copied from interface:ArtifactPathBuilder
Always returns a entity-oriented path, never a global storage path. ie. returns [artifact-root] / [chain-storage-tag] / [job-part] / [build-part] / [label-part] [job-part] will be "shared" if the artifact is shared or if planResultKey points to a chain rather than a job. [label-part] will be omitted if artifactDefinition is null.- Specified by:
getEntityOrientedArtifactPath
in interfaceArtifactPathBuilder
-
getChainPath
Description copied from interface:ArtifactPathBuilder
Returns [artifact-root] / [chain-storage-tag]- Specified by:
getChainPath
in interfaceArtifactPathBuilder
-
getBuildPath
Description copied from interface:ArtifactPathBuilder
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.- Specified by:
getBuildPath
in interfaceArtifactPathBuilder
-