public static String getPathForBranch ( State state , String path , int numBranches , int branchId ) { Preconditions . checkNotNull ( state ) ; Preconditions . checkNotNull ( path ) ; Preconditions . checkArgument ( numBranches >= 0 , "The number of branches is expected to be non-negative" ) ; Preconditions . checkArgument ( branchId >= 0 , "The branch id is expected to be non-negative" ) ; return numBranches > 1 ? path + Path . SEPARATOR + state . getProp ( ConfigurationKeys . FORK_BRANCH_NAME_KEY + "." + branchId , ConfigurationKeys . DEFAULT_FORK_BRANCH_NAME + branchId ) : path ; }
Get a new path with the given branch name as a sub directory .