public class UploadSpecHelper
extends java.lang.Object
| Constructor and Description |
|---|
UploadSpecHelper() |
| Modifier and Type | Method and Description |
|---|---|
static DeployDetails |
buildDeployDetails(java.lang.String targetPath,
java.io.File artifactFile,
java.lang.String uploadTarget,
java.lang.String explode,
java.lang.String props,
com.google.common.collect.Multimap<java.lang.String,java.lang.String> buildProperties)
Create a DeployDetails from the given properties
|
static java.lang.String |
calculateFileTargetPath(java.io.File patternDir,
java.io.File file,
java.lang.String targetPath) |
static java.lang.String |
calculateTargetRelativePath(java.io.File artifactFile) |
static java.lang.String |
getLocalPath(java.lang.String path)
Remove repository's name from a given Spec's target
|
static java.lang.String |
getRegexBaseDir(java.io.File workspaceDir,
java.lang.String pattern)
Returns base directory path with slash in the end.
|
static java.lang.String |
getRelativePath(java.io.File base,
java.io.File file)
Gets the relative path of a given file to the base
|
static java.lang.String |
getRelativeToWsPath(java.lang.String absolutePath,
java.lang.String workspacePath)
Gets the relative path of a given file to the workspace path.
|
protected static java.lang.String |
getUploadPath(java.io.File file,
java.util.regex.Pattern pathPattern,
java.lang.String targetPath,
boolean isFlat,
boolean isAbsolutePath,
java.io.File workspaceDir,
boolean isTargetDirectory) |
static com.google.common.collect.Multimap<java.lang.String,java.io.File> |
getUploadPathsMap(java.util.List<java.io.File> files,
java.io.File workspaceDir,
java.lang.String targetPath,
boolean isFlat,
java.util.regex.Pattern regexPattern,
boolean isAbsolutePath) |
static java.lang.String |
getWildcardBaseDir(java.io.File workspaceDir,
java.lang.String pattern)
Returns base directory path with slash in the end.
|
static java.lang.String |
prepareExcludePattern(java.lang.String[] excludePatterns,
boolean isWildcard,
boolean recursive) |
static java.lang.String |
prepareRegexPattern(java.io.File workspaceDir,
java.lang.String pattern,
java.lang.String baseDir)
The user can provide pattern that will contain static path (without wildcards) that will become part of the base directory.
|
static java.lang.String |
prepareWildcardPattern(java.io.File workspaceDir,
java.lang.String pattern,
java.lang.String baseDir)
The user can provide pattern that will contain static path (without wildcards) that will become part of the base directory.
|
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
|
public static DeployDetails buildDeployDetails(java.lang.String targetPath, java.io.File artifactFile, java.lang.String uploadTarget, java.lang.String explode, java.lang.String props, com.google.common.collect.Multimap<java.lang.String,java.lang.String> buildProperties) throws java.io.IOException, java.security.NoSuchAlgorithmException
targetPath - target of the created artifact in ArtifactoryartifactFile - the artifact to deployuploadTarget - target repository in Artifactoryexplode - explode archiveprops - properties to attach to the deployed filebuildProperties - a map of properties to add to the DeployDetails objectsjava.io.IOExceptionjava.security.NoSuchAlgorithmExceptionpublic static java.lang.String wildcardCalculateTargetPath(java.lang.String targetPattern,
java.io.File artifactFile)
targetPattern - a wildcard pattern of the target pathartifactFile - the artifact file to calculate target deployment path forpublic static java.lang.String calculateTargetRelativePath(java.io.File artifactFile)
public static java.lang.String getRelativeToWsPath(java.lang.String absolutePath,
java.lang.String workspacePath)
absolutePath - the file's absolute pathworkspacePath - path to the job's workspacepublic static java.lang.String prepareExcludePattern(java.lang.String[] excludePatterns,
boolean isWildcard,
boolean recursive)
protected static java.lang.String getUploadPath(java.io.File file,
java.util.regex.Pattern pathPattern,
java.lang.String targetPath,
boolean isFlat,
boolean isAbsolutePath,
java.io.File workspaceDir,
boolean isTargetDirectory)
public static com.google.common.collect.Multimap<java.lang.String,java.io.File> getUploadPathsMap(java.util.List<java.io.File> files,
java.io.File workspaceDir,
java.lang.String targetPath,
boolean isFlat,
java.util.regex.Pattern regexPattern,
boolean isAbsolutePath)
public static java.lang.String getWildcardBaseDir(java.io.File workspaceDir,
java.lang.String pattern)
workspaceDir - the workspaceDir directorypattern - the pattern provided by the userpublic static java.lang.String getRegexBaseDir(java.io.File workspaceDir,
java.lang.String pattern)
throws java.io.FileNotFoundException
workspaceDir - the workspaceDir directorypattern - the pattern provided by the userjava.io.FileNotFoundExceptionpublic static java.lang.String prepareRegexPattern(java.io.File workspaceDir,
java.lang.String pattern,
java.lang.String baseDir)
workspaceDir - the workspaceDir directorypattern - the provided by the user patternbaseDir - the calculated base directorypublic static java.lang.String prepareWildcardPattern(java.io.File workspaceDir,
java.lang.String pattern,
java.lang.String baseDir)
workspaceDir - the workspaceDir directorypattern - the provided by the user patternbaseDir - the calculated base directorypublic static java.lang.String getRelativePath(java.io.File base,
java.io.File file)
base - the base path to calculate the relative pathfile - the file itselfpublic static java.lang.String calculateFileTargetPath(java.io.File patternDir,
java.io.File file,
java.lang.String targetPath)
public static java.lang.String getLocalPath(java.lang.String path)
path - target path in Artifactory