Class ArtifactHandlingUtils


  • public final class ArtifactHandlingUtils
    extends Object
    • 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 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)
                                    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

        @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 key
        settingKey - setting name
        Returns:
        config key