public static String resolveBranchBase( String repositoryUrl ) { return appendPath( getProjectRoot( repositoryUrl ), SVN_BRANCHES ); }
public static String resolveTagBase( String repositoryUrl ) { return appendPath( getProjectRoot( repositoryUrl ), SVN_TAGS ); }
public static String resolveTagBase( String repositoryUrl ) { return appendPath( getProjectRoot( repositoryUrl ), SVN_TAGS ); }
public static String resolveBranchBase( String repositoryUrl ) { return appendPath( getProjectRoot( repositoryUrl ), SVN_BRANCHES ); }
/** * Returns the project root for the given repository url, * where "project root" is the root of the /trunk, /branches, /tags * directories * * @param repoPath Repository path/url to be searched * @return */ public static String getProjectRoot( String repoPath ) { for ( int i = 0; i < SVN_BASE_DIRS.length; i++ ) { String base = "/" + SVN_BASE_DIRS[i]; int pos = repoPath.lastIndexOf( base + "/" ); if ( repoPath.endsWith( base ) ) { return repoPath.substring( 0, repoPath.length() - base.length() ); } else if ( pos >= 0 ) { return repoPath.substring( 0, pos ); } } // At this point we were unable to locate the project root of this url // so assume that the repository url specified is the project root return appendPath( repoPath, null ); }
/** * Returns the project root for the given repository url, * where "project root" is the root of the /trunk, /branches, /tags * directories * * @param repoPath Repository path/url to be searched * @return */ public static String getProjectRoot( String repoPath ) { for ( int i = 0; i < SVN_BASE_DIRS.length; i++ ) { String base = "/" + SVN_BASE_DIRS[i]; int pos = repoPath.lastIndexOf( base + "/" ); if ( repoPath.endsWith( base ) ) { return repoPath.substring( 0, repoPath.length() - base.length() ); } else if ( pos >= 0 ) { return repoPath.substring( 0, pos ); } } // At this point we were unable to locate the project root of this url // so assume that the repository url specified is the project root return appendPath( repoPath, null ); }
&& !tagBase.equals( resolveBranchBase( repositoryUrl ) ) ) return appendPath( tagBase, branchTagName ); return addSuffix( appendPath( projectRoot, branchTagName ), queryString ); return addSuffix( appendPath( appendPath( projectRoot, subdir ), branchTagName ), queryString );
&& !tagBase.equals( resolveBranchBase( repositoryUrl ) ) ) return appendPath( tagBase, branchTagName ); return addSuffix( appendPath( projectRoot, branchTagName ), queryString ); return addSuffix( appendPath( appendPath( projectRoot, subdir ), branchTagName ), queryString );