Class ArtifactPathBuilderImpl
java.lang.Object
com.atlassian.bamboo.storage.location.ArtifactPathBuilderImpl
- All Implemented Interfaces:
ArtifactPathBuilder
- Direct Known Subclasses:
ArtifactPathBuilderFactoryImpl.ArtifactPathBuilderForTemporaryStorage
-
Constructor Summary
ConstructorsConstructorDescriptionArtifactPathBuilderImpl(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 StringgetArtifactDefinitionLabel(@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().getArtifactPath(Artifact artifact, @Nullable ImmutableArtifactDefinitionBase artifactDefinition) Returns a entity-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:ArtifactPathBuilderReturns 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:
getRootPathin interfaceArtifactPathBuilder
-
getTemporaryPath
Description copied from interface:ArtifactPathBuilderReturns a path that can be used for temporary storage underneath the artifact root storage path.- Specified by:
getTemporaryPathin interfaceArtifactPathBuilder
-
getArtifactPath
Description copied from interface:ArtifactPathBuilderReturns a plan-oriented or global storage path for the supplied artifact, based on the return value of artifact.isGloballyStored().- Specified by:
getArtifactPathin interfaceArtifactPathBuilder
-
getArtifactPath
public String getArtifactPath(Artifact artifact, @Nullable @Nullable ImmutableArtifactDefinitionBase artifactDefinition) Description copied from interface:ArtifactPathBuilderReturns a entity-oriented or global storage path for the supplied artifact, based on the return value of artifact.isGloballyStored().- Specified by:
getArtifactPathin interfaceArtifactPathBuilder
-
getArtifactDefinitionLabel
protected String getArtifactDefinitionLabel(@Nullable @Nullable ImmutableArtifactDefinitionBase artifactDefinition) -
getPlanOrientedArtifactPath
public String getPlanOrientedArtifactPath(PlanResultKey planResultKey, @Nullable @Nullable ImmutableArtifactDefinitionBase artifactDefinition) Description copied from interface:ArtifactPathBuilderAlways 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:
getPlanOrientedArtifactPathin interfaceArtifactPathBuilder
-
getEntityOrientedArtifactPath
public String getEntityOrientedArtifactPath(ResultKey resultKey, @Nullable @Nullable ImmutableArtifactDefinitionBase artifactDefinition) Description copied from interface:ArtifactPathBuilderAlways 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:
getEntityOrientedArtifactPathin interfaceArtifactPathBuilder
-
getChainPath
Description copied from interface:ArtifactPathBuilderReturns [artifact-root] / [chain-storage-tag]- Specified by:
getChainPathin interfaceArtifactPathBuilder
-
getBuildPath
Description copied from interface:ArtifactPathBuilderReturns [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:
getBuildPathin interfaceArtifactPathBuilder
-