private String[] splitTfvcCollectionUrl(final String collectionUrl){
  final String[] result=new String[2];
  if (StringUtils.isEmpty(collectionUrl)) {
    return result;
  }
  final String trimmedUrl=UrlHelper.trimTrailingSeparators(collectionUrl);
  final int index=trimmedUrl.lastIndexOf(UrlHelper.URL_SEPARATOR);
  if (index >= 0) {
    result[0]=trimmedUrl.substring(0,index + 1);
    result[1]=trimmedUrl.substring(index + 1);
  }
 else {
    result[0]=collectionUrl;
    result[1]=StringUtils.EMPTY;
  }
  return result;
}

private String [ ] splitTfvcCollectionUrl ( final String collectionUrl ) { final String [ ] result = new String [ 2 ] ; if ( StringUtils . isEmpty ( collectionUrl ) ) { return result ; } final String trimmedUrl = UrlHelper . trimTrailingSeparators ( collectionUrl ) ; final int index = trimmedUrl . lastIndexOf ( UrlHelper . URL_SEPARATOR ) ; if ( index >= 0 ) { result [ 0 ] = trimmedUrl . substring ( 0 , index + 1 ) ; result [ 1 ] = trimmedUrl . substring ( index + 1 ) ; } else { result [ 0 ] = collectionUrl ; result [ 1 ] = StringUtils . EMPTY ; } return result ; }
this method parses the collection url into 2 parts : 0 : the server url ( ending in a slash ) 1 : the collection name ( no slashes )
