Class ArtifactPathBuilderImpl
- java.lang.Object
-
- com.atlassian.bamboo.storage.location.ArtifactPathBuilderImpl
-
- All Implemented Interfaces:
ArtifactPathBuilder
- Direct Known Subclasses:
ArtifactPathBuilderFactoryImpl.ArtifactPathBuilderForTemporaryStorage
public class ArtifactPathBuilderImpl extends Object implements ArtifactPathBuilder
-
-
Constructor Summary
Constructors Constructor Description ArtifactPathBuilderImpl(char separatorChar)
Constructor for building relative paths.ArtifactPathBuilderImpl(String rootPath, char separatorChar)
Constructor for building absolute paths.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected String
getArtifactDefinitionLabel(@Nullable ImmutableArtifactDefinitionBase artifactDefinition)
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, @Nullable 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, @Nullable 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.
-
-
-
Constructor Detail
-
ArtifactPathBuilderImpl
public ArtifactPathBuilderImpl(String rootPath, char separatorChar)
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
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 Detail
-
getRootPath
public String 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
public String 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
public String getArtifactPath(Artifact artifact)
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
public String getChainPath(PlanKey planKey)
Description copied from interface:ArtifactPathBuilder
Returns [artifact-root] / [chain-storage-tag]- Specified by:
getChainPath
in interfaceArtifactPathBuilder
-
getJobOrSharedPath
public String getJobOrSharedPath(PlanKey planKey)
Description copied from interface:ArtifactPathBuilder
Returns [artifact-root] / [chain-storage-tag] / [job-part] [job-part] will be "shared" if the parameter points to a chain rather than a job.- Specified by:
getJobOrSharedPath
in interfaceArtifactPathBuilder
-
getBuildPath
public String getBuildPath(PlanResultKey planResultKey)
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
-
-