com.microsoft.tfs.core.clients.build.utils
Class BuildPath

java.lang.Object
  extended by com.microsoft.tfs.core.clients.build.utils.BuildPath

public class BuildPath
extends java.lang.Object

Utility class for helping with the handling of build paths.

Since:
TEE-SDK-10.1

Field Summary
static java.lang.String PATH_SEPERATOR
           
static char PATH_SEPERATOR_CHAR
           
static java.lang.String RECURSION_OPERATOR
           
static java.lang.String ROOT_FOLDER
           
static java.lang.String SLASH_RECURSION_OPERATOR
           
 
Constructor Summary
BuildPath()
           
 
Method Summary
static java.lang.String combine(java.lang.String teamProject, java.lang.String itemName)
          Return the build path built from TeamProject and item - in form $/TeamProject/item
static java.lang.String getItemName(java.lang.String buildPath)
          Returns just the name portion of a path.
static java.lang.String getTeamProject(java.lang.String buildPath)
          Returns the team project portion of the build path.
static java.lang.String root(java.lang.String rootPath, java.lang.String relativePath)
          Given a root and a path this method will return a combined path which is canonicalized and rooted at the new root.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PATH_SEPERATOR

public static final java.lang.String PATH_SEPERATOR
Constant Field Value:
"\\"
See Also:
Constant Field Values

PATH_SEPERATOR_CHAR

public static final char PATH_SEPERATOR_CHAR
Constant Field Value:
92
See Also:
Constant Field Values

RECURSION_OPERATOR

public static final java.lang.String RECURSION_OPERATOR
Constant Field Value:
"*"
See Also:
Constant Field Values

SLASH_RECURSION_OPERATOR

public static final java.lang.String SLASH_RECURSION_OPERATOR
Constant Field Value:
"\\*"
See Also:
Constant Field Values

ROOT_FOLDER

public static final java.lang.String ROOT_FOLDER
Constant Field Value:
"\\"
See Also:
Constant Field Values
Constructor Detail

BuildPath

public BuildPath()
Method Detail

getItemName

public static java.lang.String getItemName(java.lang.String buildPath)
Returns just the name portion of a path. If the path contains only a team project then the file name will be empty.

Parameters:
buildPath - The path from which to retrieve the item name
Returns:
A string representing the leaf name of the path (the last part following the \).

getTeamProject

public static java.lang.String getTeamProject(java.lang.String buildPath)
Returns the team project portion of the build path.

Parameters:
buildPath - The path from which to retrieve the team project.
Returns:
The team project portion of the build path.

combine

public static java.lang.String combine(java.lang.String teamProject,
                                       java.lang.String itemName)
Return the build path built from TeamProject and item - in form $/TeamProject/item

Parameters:
teamProject - The team project that the build belongs to.
itemName - The item in the Team Project.
Returns:
String containing build path in the form $/TeamProject/item.

root

public static java.lang.String root(java.lang.String rootPath,
                                    java.lang.String relativePath)
Given a root and a path this method will return a combined path which is canonicalized and rooted at the new root.

Parameters:
rootPath - The new root which should be used
relativePath - The path which should be appended to the new root
Returns:
A fully-qualified, canonicalized path formed by combining the two paths


© 2015 Microsoft. All rights reserved.