org.jfrog.build.extractor.clientConfiguration.util
Class PublishedItemsHelper

java.lang.Object
  extended by org.jfrog.build.extractor.clientConfiguration.util.PublishedItemsHelper

public class PublishedItemsHelper
extends java.lang.Object

Helper class for calculating published artifacts of a generic deployment.


Constructor Summary
PublishedItemsHelper()
           
 
Method Summary
static com.google.common.collect.Multimap<java.lang.String,java.io.File> buildPublishingData(java.io.File checkoutDir, java.lang.String pattern, java.lang.String targetPath)
          Building a multi map of target paths mapped to their files.
static java.lang.String calculateTargetPath(java.lang.String targetPattern, java.io.File artifactFile)
          Calculates the target deployment path of an artifact by it's name
static com.google.common.collect.Multimap<java.lang.String,java.lang.String> getPublishedItemsPatternPairs(java.lang.String publishedItemsPropertyValue)
          Splits a given property value to pairs of source and target strings (the splitter is '=>' the source represents the Ant Pattern to search for the target represents the target path to deploy the found artifacts Multi values as acceptable by new lined or comma separated.
static java.util.List<java.lang.String> parsePatternsFromProperty(java.lang.String publishedItemsPropertyValue)
          Splits the given property value by new lines or by commas.
static java.lang.String removeDoubleDotsFromPattern(java.lang.String pattern)
           
static com.google.common.collect.Multimap<java.lang.String,java.io.File> wildCardBuildPublishingData(java.io.File checkoutDir, java.lang.String pattern, java.lang.String targetPath, boolean flat, boolean isRecursive, boolean regexp)
          Building a multi map of target paths mapped to their files using wildcard pattern.
static java.lang.String wildcardCalculateTargetPath(java.lang.String targetPattern, java.io.File artifactFile)
          Calculates the target deployment path of an artifact by it's name
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PublishedItemsHelper

public PublishedItemsHelper()
Method Detail

getPublishedItemsPatternPairs

public static com.google.common.collect.Multimap<java.lang.String,java.lang.String> getPublishedItemsPatternPairs(java.lang.String publishedItemsPropertyValue)
Splits a given property value to pairs of source and target strings (the splitter is '=>' the source represents the Ant Pattern to search for the target represents the target path to deploy the found artifacts Multi values as acceptable by new lined or comma separated.

Parameters:
publishedItemsPropertyValue - the string value to split, if the splitter '=>' was not found then the value is treated as a source only (target will be "").
Returns:
a Map containing the sources as keys and targets as values

parsePatternsFromProperty

public static java.util.List<java.lang.String> parsePatternsFromProperty(java.lang.String publishedItemsPropertyValue)
Splits the given property value by new lines or by commas.

Parameters:
publishedItemsPropertyValue - The property value to split
Returns:
a List of the splinted parameter by new lines or commas.

removeDoubleDotsFromPattern

public static java.lang.String removeDoubleDotsFromPattern(java.lang.String pattern)

buildPublishingData

public static com.google.common.collect.Multimap<java.lang.String,java.io.File> buildPublishingData(java.io.File checkoutDir,
                                                                                                    java.lang.String pattern,
                                                                                                    java.lang.String targetPath)
                                                                                             throws java.io.IOException
Building a multi map of target paths mapped to their files.

Parameters:
checkoutDir - the base directory of which to calculate the given source ant pattern
pattern - the Ant pattern to calculate the files from
targetPath - the target path for deployment of a file
Returns:
a Multimap containing the targets as keys and the files as values
Throws:
java.io.IOException - in case of any file system exception

wildCardBuildPublishingData

public static com.google.common.collect.Multimap<java.lang.String,java.io.File> wildCardBuildPublishingData(java.io.File checkoutDir,
                                                                                                            java.lang.String pattern,
                                                                                                            java.lang.String targetPath,
                                                                                                            boolean flat,
                                                                                                            boolean isRecursive,
                                                                                                            boolean regexp)
                                                                                                     throws java.io.IOException
Building a multi map of target paths mapped to their files using wildcard pattern.

Parameters:
checkoutDir - the base directory of which to calculate the given source ant pattern
pattern - the Ant pattern to calculate the files from
targetPath - the target path for deployment of a file
Returns:
a Multimap containing the targets as keys and the files as values
Throws:
java.io.IOException - in case of any file system exception

wildcardCalculateTargetPath

public static java.lang.String wildcardCalculateTargetPath(java.lang.String targetPattern,
                                                           java.io.File artifactFile)
Calculates the target deployment path of an artifact by it's name

Parameters:
targetPattern - a wildcard pattern of the target path
artifactFile - the artifact file to calculate target deployment path for
Returns:
the calculated target path (supports file renaming).

calculateTargetPath

public static java.lang.String calculateTargetPath(java.lang.String targetPattern,
                                                   java.io.File artifactFile)
Calculates the target deployment path of an artifact by it's name

Parameters:
targetPattern - an Ant pattern of the target path
artifactFile - the artifact file to calculate target deployment path for
Returns:
the calculated target path