legacy/src/main/java/thredds/cataloggen/CollectionLevelScanner.java
private String getUrlPath( CrawlableDataset dataset, InvService service )
  {
    InvService serviceForThisDs = service != null ? service : this.service;

    if ( serviceForThisDs.getBase().equals( "" )
         && ! serviceForThisDs.getServiceType().equals( ServiceType.COMPOUND ) )
    {
      // Service is relative to the catalog URL.
      String urlPath = dataset.getPath().substring( catalogLevel.getPath().length() );
      if ( urlPath.startsWith( "/" ))
        urlPath = urlPath.substring( 1 );
      return urlPath;
    }
    else
    {
      if ( serviceForThisDs.isRelativeBase() )
      {
        // Service is relative to the collection root.
        String relPath = dataset.getPath().substring( collectionLevel.getPath().length() );
        if ( relPath.startsWith( "/" ) )
          relPath = relPath.substring( 1 );
        return ( ( collectionPath.equals( "" ) ? "" : collectionPath + "/" ) + relPath );
      }
      else
      {
        // Service base URI is Absolute so don't use collectionPath.
        String relPath = dataset.getPath().substring( collectionLevel.getPath().length() );
        if ( relPath.startsWith( "/" ) )
          relPath = relPath.substring( 1 );
        return relPath;
      }
    }
  }
private String getUrlPath( CrawlableDataset dataset, InvService service )
  {
    InvService serviceForThisDs = service != null ? service : this.service;

    if ( serviceForThisDs.getBase().equals( "" )
         && ! serviceForThisDs.getServiceType().equals( ServiceType.COMPOUND ) )
    {
      // Service is relative to the catalog URL.
      String urlPath = dataset.getPath().substring( catalogLevel.getPath().length() );
      if ( urlPath.startsWith( "/" ))
        urlPath = urlPath.substring( 1 );
      return urlPath;
    }
    else
    {
      if ( serviceForThisDs.isRelativeBase() )
      {
        // Service is relative to the collection root.
        String relPath = dataset.getPath().substring( collectionLevel.getPath().length() );
        if ( relPath.startsWith( "/" ) )
          relPath = relPath.substring( 1 );
        return ( ( collectionPath.equals( "" ) ? "" : collectionPath + "/" ) + relPath );
      }
      else
      {
        // Service base URI is Absolute so don't use collectionPath.
        String relPath = dataset.getPath().substring( collectionLevel.getPath().length() );
        if ( relPath.startsWith( "/" ) )
          relPath = relPath.substring( 1 );
        return relPath;
      }
    }
  }
private String getUrlPath ( CrawlableDataset dataset , InvService service ) { InvService serviceForThisDs = service != null ? service : this . service ; if ( serviceForThisDs . getBase ( ) . equals ( "" ) && ! serviceForThisDs . getServiceType ( ) . equals ( ServiceType . COMPOUND ) ) { // Service is relative to the catalog URL. String urlPath = dataset . getPath ( ) . substring ( catalogLevel . getPath ( ) . length ( ) ) ; if ( urlPath . startsWith ( "/" ) ) urlPath = urlPath . substring ( 1 ) ; return urlPath ; } else { if ( serviceForThisDs . isRelativeBase ( ) ) { // Service is relative to the collection root. String relPath = dataset . getPath ( ) . substring ( collectionLevel . getPath ( ) . length ( ) ) ; if ( relPath . startsWith ( "/" ) ) relPath = relPath . substring ( 1 ) ; return ( ( collectionPath . equals ( "" ) ? "" : collectionPath + "/" ) + relPath ) ; } else { // Service base URI is Absolute so don't use collectionPath. String relPath = dataset . getPath ( ) . substring ( collectionLevel . getPath ( ) . length ( ) ) ; if ( relPath . startsWith ( "/" ) ) relPath = relPath . substring ( 1 ) ; return relPath ; } } }
- collectionPath + "/" + node.getPath().substring( collectionLevel.length) [when service is absolute (i.e., relative to collection)]
- collectionPath + / + node . getPath () . substring ( collectionLevel . length ) [ when service is absolute ( i . e . relative to collection ) ]