Class ArtifactHandlingUtils
java.lang.Object
com.atlassian.bamboo.build.artifact.ArtifactHandlingUtils
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
copyFileSet
(org.apache.tools.ant.types.FileSet sourceFileSet, File destinationDirectory) static @NotNull org.apache.tools.ant.types.FileSet
createFileSet
(File baseDirectory, ArtifactDefinitionContext artifact, boolean useRelativeLocation, @Nullable org.apache.log4j.Logger log) Creates a FileSet object.static com.google.common.collect.Ordering<ArtifactHandler>
fastestFirstOrdering
(@NotNull Map<String, String> artifactHandlersConfiguration) static ArtifactHandler
getArtifactHandlerForLink
(com.atlassian.plugin.PluginAccessor pluginAccessor, String linkType) static @NotNull File
getArtifactLocation
(@NotNull File baseDirectory, @NotNull ArtifactDefinitionContext artifact, boolean useRelativeLocation) static @NotNull String
getArtifactMatchDescription
(@NotNull ArtifactDefinitionContext artifact, @NotNull org.apache.tools.ant.types.FileSet sourceFileSet) static @Nullable String
getArtifactUrl
(@NotNull ArtifactLinkManager artifactLinkManager, @NotNull Artifact artifact, @NotNull String baseUrl) static @Nullable String
getArtifactUrl
(@NotNull ArtifactLinkManager artifactLinkManager, @NotNull ArtifactLink artifactLink, @NotNull String baseUrl) Deprecated.static @NotNull String
getConfigKey
(@NotNull String moduleDescriptorKey, @NotNull String settingKey) Generate settings config key to be accessible at Artifact Handlers' configstatic boolean
isCustomArtifactHandlingConfigured
(Map<String, String> planCustomConfiguration) static boolean
Bamboo has list of 'default' artifact handlers which are enabled by default.static boolean
isServerLocalArtifactHandler
(String linkType) static void
moveFileSet
(org.apache.tools.ant.types.FileSet sourceFileSet, File destinationDirectory) static @NotNull Path
resolveArtifactLocation
(Path basePath, @Nullable String location) static void
transferFileSet
(org.apache.tools.ant.types.FileSet sourceFileSet, File destinationDirectory, boolean deleteSource)
-
Field Details
-
SERVER_LOCAL_HANDLER
- See Also:
-
SERVER_REMOTE_HANDLER
- See Also:
-
S3_HANDLER
- See Also:
-
PLAN_CUSTOM_ARTIFACT_HANDLERS_CONFIG_PATH
- See Also:
-
-
Method Details
-
createFileSet
@NotNull public static @NotNull org.apache.tools.ant.types.FileSet createFileSet(File baseDirectory, ArtifactDefinitionContext artifact, boolean useRelativeLocation, @Nullable @Nullable org.apache.log4j.Logger log) throws FileNotFoundException Creates a FileSet object.- Parameters:
baseDirectory
- directory used to resolve the copy patternsartifact
- artifact definitionuseRelativeLocation
- used to determine whether the relative location information from artifact definition should be usedlog
- optional logger to use for logging of fileset processing- Returns:
- the created FileSet
- Throws:
IllegalArgumentException
- if the artifact source is not a directoryFileNotFoundException
-
copyFileSet
public static void copyFileSet(org.apache.tools.ant.types.FileSet sourceFileSet, File destinationDirectory) throws IOException - Throws:
IOException
-
moveFileSet
public static void moveFileSet(org.apache.tools.ant.types.FileSet sourceFileSet, File destinationDirectory) throws IOException - Throws:
IOException
-
transferFileSet
public static void transferFileSet(org.apache.tools.ant.types.FileSet sourceFileSet, File destinationDirectory, boolean deleteSource) throws IOException - Throws:
IOException
-
getArtifactLocation
@NotNull public static @NotNull File getArtifactLocation(@NotNull @NotNull File baseDirectory, @NotNull @NotNull ArtifactDefinitionContext artifact, boolean useRelativeLocation) -
resolveArtifactLocation
-
getArtifactMatchDescription
@NotNull public static @NotNull String getArtifactMatchDescription(@NotNull @NotNull ArtifactDefinitionContext artifact, @NotNull @NotNull org.apache.tools.ant.types.FileSet sourceFileSet) -
fastestFirstOrdering
public static com.google.common.collect.Ordering<ArtifactHandler> fastestFirstOrdering(@NotNull @NotNull Map<String, String> artifactHandlersConfiguration) -
getArtifactUrl
@Deprecated @Nullable public static @Nullable String getArtifactUrl(@NotNull @NotNull ArtifactLinkManager artifactLinkManager, @NotNull @NotNull ArtifactLink artifactLink, @NotNull @NotNull String baseUrl) Deprecated.since 5.6 usegetArtifactUrl(ArtifactLinkManager, com.atlassian.bamboo.artifact.Artifact, String)
instead -
getArtifactUrl
@Nullable public static @Nullable String getArtifactUrl(@NotNull @NotNull ArtifactLinkManager artifactLinkManager, @NotNull @NotNull Artifact artifact, @NotNull @NotNull String baseUrl) -
isCustomArtifactHandlingConfigured
-
isServerLocalArtifactHandler
-
getArtifactHandlerForLink
public static ArtifactHandler getArtifactHandlerForLink(com.atlassian.plugin.PluginAccessor pluginAccessor, String linkType) -
isDefaultArtifactHandler
Bamboo has list of 'default' artifact handlers which are enabled by default.- Parameters:
key
- complete plugin key- Returns:
- true if artifact handler should be enabled by default
-
getConfigKey
@NotNull public static @NotNull String getConfigKey(@NotNull @NotNull String moduleDescriptorKey, @NotNull @NotNull String settingKey) Generate settings config key to be accessible at Artifact Handlers' config- Parameters:
moduleDescriptorKey
- ArtifactHandler descriptor full keysettingKey
- setting name- Returns:
- config key
-
getArtifactUrl(ArtifactLinkManager, com.atlassian.bamboo.artifact.Artifact, String)
instead