Class ArtifactHandlingUtils
- java.lang.Object
-
- com.atlassian.bamboo.build.artifact.ArtifactHandlingUtils
-
public final class ArtifactHandlingUtils extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static String
PLAN_CUSTOM_ARTIFACT_HANDLERS_CONFIG_PATH
static String
S3_HANDLER
static String
SERVER_LOCAL_HANDLER
static String
SERVER_REMOTE_HANDLER
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static 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.since 5.6 usegetArtifactUrl(ArtifactLinkManager, com.atlassian.bamboo.artifact.Artifact, String)
insteadstatic @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
isDefaultArtifactHandler(String key)
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 Detail
-
SERVER_LOCAL_HANDLER
public static final String SERVER_LOCAL_HANDLER
- See Also:
- Constant Field Values
-
SERVER_REMOTE_HANDLER
public static final String SERVER_REMOTE_HANDLER
- See Also:
- Constant Field Values
-
S3_HANDLER
public static final String S3_HANDLER
- See Also:
- Constant Field Values
-
PLAN_CUSTOM_ARTIFACT_HANDLERS_CONFIG_PATH
public static final String PLAN_CUSTOM_ARTIFACT_HANDLERS_CONFIG_PATH
- See Also:
- Constant Field Values
-
-
Method Detail
-
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
@NotNull public static @NotNull Path resolveArtifactLocation(Path basePath, @Nullable @Nullable String location)
-
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
public static boolean isCustomArtifactHandlingConfigured(Map<String,String> planCustomConfiguration)
-
isServerLocalArtifactHandler
public static boolean isServerLocalArtifactHandler(String linkType)
-
getArtifactHandlerForLink
public static ArtifactHandler getArtifactHandlerForLink(com.atlassian.plugin.PluginAccessor pluginAccessor, String linkType)
-
isDefaultArtifactHandler
public static boolean isDefaultArtifactHandler(String key)
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
-
-