com.atlassian.bamboo.build.artifact
Class ArtifactHandlingUtils

java.lang.Object
  extended by com.atlassian.bamboo.build.artifact.ArtifactHandlingUtils

public final class ArtifactHandlingUtils
extends Object


Field Summary
static String SERVER_LOCAL_HANDLER
           
static String SERVER_REMOTE_HANDLER
           
 
Method Summary
static void copyFileSet(org.apache.tools.ant.types.FileSet sourceFileSet, File destinationDirectory)
           
static org.apache.tools.ant.types.FileSet createFileSet(File baseDirectory, ArtifactDefinitionContext artifact, boolean useRelativeLocation, org.apache.log4j.Logger log)
          Creates a FileSet object.
static com.google.common.collect.Ordering<ArtifactHandler> fastestFirstOrdering(Map<String,String> artifactHandlersConfiguration)
           
static ArtifactHandler getArtifactHandlerForLink(com.atlassian.plugin.PluginAccessor pluginAccessor, String linkType)
           
static File getArtifactLocation(File baseDirectory, ArtifactDefinitionContext artifact, boolean useRelativeLocation)
           
static String getArtifactMatchDescription(ArtifactDefinitionContext artifact, org.apache.tools.ant.types.FileSet sourceFileSet)
           
static String getArtifactUrl(ArtifactLinkManager artifactLinkManager, ArtifactLink artifactLink, String baseUrl)
          Deprecated. since 5.6 use getArtifactUrl(ArtifactLinkManager, com.atlassian.bamboo.artifact.Artifact, String) instead
static String getArtifactUrl(ArtifactLinkManager artifactLinkManager, Artifact artifact, String baseUrl)
           
static 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 void transferFileSet(org.apache.tools.ant.types.FileSet sourceFileSet, File destinationDirectory, boolean deleteSource, boolean debug)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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
Method Detail

createFileSet

@NotNull
public static org.apache.tools.ant.types.FileSet createFileSet(File baseDirectory,
                                                                       ArtifactDefinitionContext artifact,
                                                                       boolean useRelativeLocation,
                                                                       @Nullable
                                                                       org.apache.log4j.Logger log)
                                                        throws FileNotFoundException
Creates a FileSet object.

Parameters:
baseDirectory - directory used to resolve the copy patterns
artifact - artifact definition
useRelativeLocation - used to determine whether the relative location information from artifact definition should be used
log - optional logger to use for logging of fileset processing
Returns:
the created FileSet
Throws:
IllegalArgumentException - if the artifact source is not a directory
FileNotFoundException

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,
                                   boolean debug)
                            throws IOException
Throws:
IOException

getArtifactLocation

@NotNull
public static File getArtifactLocation(@NotNull
                                               File baseDirectory,
                                               @NotNull
                                               ArtifactDefinitionContext artifact,
                                               boolean useRelativeLocation)

getArtifactMatchDescription

@NotNull
public static String getArtifactMatchDescription(@NotNull
                                                         ArtifactDefinitionContext artifact,
                                                         @NotNull
                                                         org.apache.tools.ant.types.FileSet sourceFileSet)

fastestFirstOrdering

public static com.google.common.collect.Ordering<ArtifactHandler> fastestFirstOrdering(@NotNull
                                                                                       Map<String,String> artifactHandlersConfiguration)

getArtifactUrl

@Deprecated
@Nullable
public static String getArtifactUrl(@NotNull
                                                        ArtifactLinkManager artifactLinkManager,
                                                        @NotNull
                                                        ArtifactLink artifactLink,
                                                        @NotNull
                                                        String baseUrl)
Deprecated. since 5.6 use getArtifactUrl(ArtifactLinkManager, com.atlassian.bamboo.artifact.Artifact, String) instead


getArtifactUrl

@Nullable
public static String getArtifactUrl(@NotNull
                                             ArtifactLinkManager artifactLinkManager,
                                             @NotNull
                                             Artifact artifact,
                                             @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


Copyright © 2015 Atlassian Software Systems Pty Ltd. All rights reserved.