Class ArtifactDirectoryBuilderImpl
- java.lang.Object
-
- com.atlassian.bamboo.storage.location.ArtifactDirectoryBuilderImpl
-
- All Implemented Interfaces:
ArtifactDirectoryBuilder
public class ArtifactDirectoryBuilderImpl extends Object implements ArtifactDirectoryBuilder
-
-
Constructor Summary
Constructors Constructor Description ArtifactDirectoryBuilderImpl(ArtifactPathBuilder pathBuilder)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description File
getArtifactDirectory(Artifact artifact)
Returns a plan-oriented or global storage directory for the supplied artifact (based on the return value of artifact.isGloballyStored().File
getBuildDirectory(PlanResultKey planResultKey)
Returns [artifact-root] / [chain-part] / [job-part] / [build-part] [job-part] will be "shared" if the parameter points to a chain rather than a job.File
getChainDirectory(PlanKey planKey)
Returns [artifact-root] / [chain-part]File
getEntityOrientedArtifactDirectory(ResultKey resultKey, ImmutableArtifactDefinitionBase artifactDefinition)
Always returns a entity-oriented directory, never a global storage directory.File
getJobOrSharedDirectory(PlanKey planKey)
Returns [artifact-root] / [chain-part] / [job-part] [job-part] will be "shared" if the parameter points to a chain rather than a job.File
getPlanOrientedArtifactDirectory(PlanResultKey planResultKey, ImmutableArtifactDefinitionBase artifactDefinition)
Always returns a plan-oriented directory, never a global storage directory.File
getRootDirectory()
Returns the root artifact storage directory that this instance is using to build absoluteFile
objects.File
getTemporaryDirectory()
Get the directory for temporary storage of artifacts.static boolean
isArtifactDirectory(File directory)
Returns true if the specified directory looks like it could be an artifact directory.
-
-
-
Constructor Detail
-
ArtifactDirectoryBuilderImpl
public ArtifactDirectoryBuilderImpl(ArtifactPathBuilder pathBuilder)
-
-
Method Detail
-
getRootDirectory
public File getRootDirectory()
Description copied from interface:ArtifactDirectoryBuilder
Returns the root artifact storage directory that this instance is using to build absoluteFile
objects.- Specified by:
getRootDirectory
in interfaceArtifactDirectoryBuilder
-
getTemporaryDirectory
public File getTemporaryDirectory()
Description copied from interface:ArtifactDirectoryBuilder
Get the directory for temporary storage of artifacts. By default it is "tmp" subdirectory of rootStorageDirectory.- Specified by:
getTemporaryDirectory
in interfaceArtifactDirectoryBuilder
-
getArtifactDirectory
public File getArtifactDirectory(Artifact artifact)
Description copied from interface:ArtifactDirectoryBuilder
Returns a plan-oriented or global storage directory for the supplied artifact (based on the return value of artifact.isGloballyStored().- Specified by:
getArtifactDirectory
in interfaceArtifactDirectoryBuilder
-
getPlanOrientedArtifactDirectory
public File getPlanOrientedArtifactDirectory(PlanResultKey planResultKey, ImmutableArtifactDefinitionBase artifactDefinition)
Description copied from interface:ArtifactDirectoryBuilder
Always returns a plan-oriented directory, never a global storage directory. ie. returns [artifact-root] / [chain-part] / [job-part] / [build-part] / [label-part] [job-part] will be "shared" if the artifact is shared or if the plan result points to a chain rather than a job. [label-part] will be omitted if artifact is null.- Specified by:
getPlanOrientedArtifactDirectory
in interfaceArtifactDirectoryBuilder
-
getEntityOrientedArtifactDirectory
public File getEntityOrientedArtifactDirectory(ResultKey resultKey, ImmutableArtifactDefinitionBase artifactDefinition)
Description copied from interface:ArtifactDirectoryBuilder
Always returns a entity-oriented directory, never a global storage directory. ie. returns [artifact-root] / [chain-part] / [job-part] / [build-part] / [label-part] [job-part] will be "shared" if the artifact is shared or if the plan result points to a chain rather than a job. [label-part] will be omitted if artifact is null.- Specified by:
getEntityOrientedArtifactDirectory
in interfaceArtifactDirectoryBuilder
-
getChainDirectory
public File getChainDirectory(PlanKey planKey)
Description copied from interface:ArtifactDirectoryBuilder
Returns [artifact-root] / [chain-part]- Specified by:
getChainDirectory
in interfaceArtifactDirectoryBuilder
-
getJobOrSharedDirectory
public File getJobOrSharedDirectory(PlanKey planKey)
Description copied from interface:ArtifactDirectoryBuilder
Returns [artifact-root] / [chain-part] / [job-part] [job-part] will be "shared" if the parameter points to a chain rather than a job.- Specified by:
getJobOrSharedDirectory
in interfaceArtifactDirectoryBuilder
-
getBuildDirectory
public File getBuildDirectory(PlanResultKey planResultKey)
Description copied from interface:ArtifactDirectoryBuilder
Returns [artifact-root] / [chain-part] / [job-part] / [build-part] [job-part] will be "shared" if the parameter points to a chain rather than a job.- Specified by:
getBuildDirectory
in interfaceArtifactDirectoryBuilder
-
isArtifactDirectory
public static boolean isArtifactDirectory(File directory)
Returns true if the specified directory looks like it could be an artifact directory. Works by checking that the parent directory name matches one of the expected patterns for the parent of an artifact directory.
-
-