legacy/src/main/java/thredds/cataloggen/CollectionLevelScanner.java
private String getXlinkHref( CrawlableDataset dataset )
  {
    // @todo Remove alias until sure how to handle things like ".scour*" being a regular file.
//    if ( ! CrawlableDatasetAlias.isAlias( catalogLevel.getPath()) )
//    {
    String path = dataset.getPath().substring( catalogLevel.getPath().length() );
    if ( path.startsWith( "/" ))
      path = path.substring( 1);
    if ( path.endsWith( "/"))
      path += "catalog.xml";
    else
      path += "/catalog.xml";
    return CatalogUtils.escapePathForURL(path);
//    }
//    else
//    {
//      // @todo Move this functionality into CrawlableDatasetAlias
//      String path = dataset.getPath();
//      int curIndex = path.length();
//      int numSegments = catalogLevel.getName().split( "/" ).length;
//      for ( int i = 0 ; i < numSegments; i++ )
//      {
//        curIndex = dataset.getPath().lastIndexOf( "/", curIndex - 1);
//      }
//      return( dataset.getPath().substring( curIndex + 1 ) + "/catalog.xml");
//    }
  }
private String getXlinkHref( CrawlableDataset dataset )
  {
    // @todo Remove alias until sure how to handle things like ".scour*" being a regular file.
//    if ( ! CrawlableDatasetAlias.isAlias( catalogLevel.getPath()) )
//    {
    String path = dataset.getPath().substring( catalogLevel.getPath().length() );
    if ( path.startsWith( "/" ))
      path = path.substring( 1);
    if ( path.endsWith( "/"))
      path += "catalog.xml";
    else
      path += "/catalog.xml";
    return CatalogUtils.escapePathForURL(path);
//    }
//    else
//    {
//      // @todo Move this functionality into CrawlableDatasetAlias
//      String path = dataset.getPath();
//      int curIndex = path.length();
//      int numSegments = catalogLevel.getName().split( "/" ).length;
//      for ( int i = 0 ; i < numSegments; i++ )
//      {
//        curIndex = dataset.getPath().lastIndexOf( "/", curIndex - 1);
//      }
//      return( dataset.getPath().substring( curIndex + 1 ) + "/catalog.xml");
//    }
  }
private String getXlinkHref ( CrawlableDataset dataset ) { // @todo Remove alias until sure how to handle things like ".scour*" being a regular file. //    if ( ! CrawlableDatasetAlias.isAlias( catalogLevel.getPath()) ) //    { String path = dataset . getPath ( ) . substring ( catalogLevel . getPath ( ) . length ( ) ) ; if ( path . startsWith ( "/" ) ) path = path . substring ( 1 ) ; if ( path . endsWith ( "/" ) ) path += "catalog.xml" ; else path += "/catalog.xml" ; return CatalogUtils . escapePathForURL ( path ) ; //    } //    else //    { //      // @todo Move this functionality into CrawlableDatasetAlias //      String path = dataset.getPath(); //      int curIndex = path.length(); //      int numSegments = catalogLevel.getName().split( "/" ).length; //      for ( int i = 0 ; i < numSegments; i++ ) //      { //        curIndex = dataset.getPath().lastIndexOf( "/", curIndex - 1); //      } //      return( dataset.getPath().substring( curIndex + 1 ) + "/catalog.xml"); //    } }
- node.getPath().substring( catalogLevel.length) + "/catalog.xml"
- node . getPath () . substring ( catalogLevel . length ) + / catalog . xml