legacy/src/main/java/thredds/catalog/InvDatasetScan.java
public InvCatalogImpl makeProxyDsResolverCatalog( String path, URI baseURI )
  {
    if ( path == null ) return null;
    if ( path.endsWith( "/")) return null;

    // Get the dataset path.
    String dsDirPath = translatePathToLocation( path );
    if ( dsDirPath == null )
    {
      log.error( "makeProxyDsResolverCatalog(): Requesting path <" + path + "> must start with \"" + rootPath + "\"." );
      return null;
    }

    // Split into parent path and dataset name.
    int pos = dsDirPath.lastIndexOf('/');
    if ( pos == -1 )
    {
      log.error( "makeProxyDsResolverCatalog(): Requesting path <" + path + "> must contain a slash (\"/\")." );
      return null;
    }
    String dsName = dsDirPath.substring( pos + 1 );
    dsDirPath = dsDirPath.substring( 0, pos );

    // Find matching ProxyDatasetHandler.
    ProxyDatasetHandler pdh = this.getProxyDatasetHandlers().get( dsName );
    if ( pdh == null )
    {
      log.error( "makeProxyDsResolverCatalog(): No matching proxy dataset handler found <" + dsName + ">." );
      return null;
    }

    // Setup and create catalog builder.
    CatalogBuilder catBuilder = buildCatalogBuilder();
    if ( catBuilder == null )
      return null;

    // Get the CrawlableDataset for the desired catalog level.
    CrawlableDataset catalogCrDs;
    try
    {
      catalogCrDs = catBuilder.requestCrawlableDataset( dsDirPath );
    }
    catch ( IOException e )
    {
      log.error( "makeProxyDsResolverCatalog(): failed to create CrawlableDataset for catalogLevel <" + dsDirPath + "> and class <" + crDsClassName + ">: " + e.getMessage(), e );
      return null;
    }
    if ( catalogCrDs == null )
    {
      log.warn( "makeProxyDsResolverCatalog(): requested catalog level <" + dsDirPath + "> not allowed (filtered out)." );
      return null;
    }
    if ( ! catalogCrDs.isCollection())
    {
      log.warn( "makeProxyDsResolverCatalog(): requested catalog level <" + dsDirPath + "> not a collection." );
      return null;
    }

    // Generate the desired catalog using the builder.
    InvCatalogImpl catalog;
    try
    {
      catalog = (InvCatalogImpl) catBuilder.generateProxyDsResolverCatalog( catalogCrDs, pdh );
    }
    catch ( IOException e )
    {
      log.error( "makeProxyDsResolverCatalog(): catalog generation failed <" + catalogCrDs.getPath() + ">: " + e.getMessage() );
      return null;
    }

    // Set the catalog base URI.
    if ( catalog != null )
      catalog.setBaseURI( baseURI );

    return catalog;
  }
public InvCatalogImpl makeProxyDsResolverCatalog( String path, URI baseURI )
  {
    if ( path == null ) return null;
    if ( path.endsWith( "/")) return null;

    // Get the dataset path.
    String dsDirPath = translatePathToLocation( path );
    if ( dsDirPath == null )
    {
      log.error( "makeProxyDsResolverCatalog(): Requesting path <" + path + "> must start with \"" + rootPath + "\"." );
      return null;
    }

    // Split into parent path and dataset name.
    int pos = dsDirPath.lastIndexOf('/');
    if ( pos == -1 )
    {
      log.error( "makeProxyDsResolverCatalog(): Requesting path <" + path + "> must contain a slash (\"/\")." );
      return null;
    }
    String dsName = dsDirPath.substring( pos + 1 );
    dsDirPath = dsDirPath.substring( 0, pos );

    // Find matching ProxyDatasetHandler.
    ProxyDatasetHandler pdh = this.getProxyDatasetHandlers().get( dsName );
    if ( pdh == null )
    {
      log.error( "makeProxyDsResolverCatalog(): No matching proxy dataset handler found <" + dsName + ">." );
      return null;
    }

    // Setup and create catalog builder.
    CatalogBuilder catBuilder = buildCatalogBuilder();
    if ( catBuilder == null )
      return null;

    // Get the CrawlableDataset for the desired catalog level.
    CrawlableDataset catalogCrDs;
    try
    {
      catalogCrDs = catBuilder.requestCrawlableDataset( dsDirPath );
    }
    catch ( IOException e )
    {
      log.error( "makeProxyDsResolverCatalog(): failed to create CrawlableDataset for catalogLevel <" + dsDirPath + "> and class <" + crDsClassName + ">: " + e.getMessage(), e );
      return null;
    }
    if ( catalogCrDs == null )
    {
      log.warn( "makeProxyDsResolverCatalog(): requested catalog level <" + dsDirPath + "> not allowed (filtered out)." );
      return null;
    }
    if ( ! catalogCrDs.isCollection())
    {
      log.warn( "makeProxyDsResolverCatalog(): requested catalog level <" + dsDirPath + "> not a collection." );
      return null;
    }

    // Generate the desired catalog using the builder.
    InvCatalogImpl catalog;
    try
    {
      catalog = (InvCatalogImpl) catBuilder.generateProxyDsResolverCatalog( catalogCrDs, pdh );
    }
    catch ( IOException e )
    {
      log.error( "makeProxyDsResolverCatalog(): catalog generation failed <" + catalogCrDs.getPath() + ">: " + e.getMessage() );
      return null;
    }

    // Set the catalog base URI.
    if ( catalog != null )
      catalog.setBaseURI( baseURI );

    return catalog;
  }
public InvCatalogImpl makeProxyDsResolverCatalog ( String path , URI baseURI ) { if ( path == null ) return null ; if ( path . endsWith ( "/" ) ) return null ; // Get the dataset path. String dsDirPath = translatePathToLocation ( path ) ; if ( dsDirPath == null ) { log . error ( "makeProxyDsResolverCatalog(): Requesting path <" + path + "> must start with \"" + rootPath + "\"." ) ; return null ; } // Split into parent path and dataset name. int pos = dsDirPath . lastIndexOf ( ' ' ) ; if ( pos == - 1 ) { log . error ( "makeProxyDsResolverCatalog(): Requesting path <" + path + "> must contain a slash (\"/\")." ) ; return null ; } String dsName = dsDirPath . substring ( pos + 1 ) ; dsDirPath = dsDirPath . substring ( 0 , pos ) ; // Find matching ProxyDatasetHandler. ProxyDatasetHandler pdh = this . getProxyDatasetHandlers ( ) . get ( dsName ) ; if ( pdh == null ) { log . error ( "makeProxyDsResolverCatalog(): No matching proxy dataset handler found <" + dsName + ">." ) ; return null ; } // Setup and create catalog builder. CatalogBuilder catBuilder = buildCatalogBuilder ( ) ; if ( catBuilder == null ) return null ; // Get the CrawlableDataset for the desired catalog level. CrawlableDataset catalogCrDs ; try { catalogCrDs = catBuilder . requestCrawlableDataset ( dsDirPath ) ; } catch ( IOException e ) { log . error ( "makeProxyDsResolverCatalog(): failed to create CrawlableDataset for catalogLevel <" + dsDirPath + "> and class <" + crDsClassName + ">: " + e . getMessage ( ) , e ) ; return null ; } if ( catalogCrDs == null ) { log . warn ( "makeProxyDsResolverCatalog(): requested catalog level <" + dsDirPath + "> not allowed (filtered out)." ) ; return null ; } if ( ! catalogCrDs . isCollection ( ) ) { log . warn ( "makeProxyDsResolverCatalog(): requested catalog level <" + dsDirPath + "> not a collection." ) ; return null ; } // Generate the desired catalog using the builder. InvCatalogImpl catalog ; try { catalog = ( InvCatalogImpl ) catBuilder . generateProxyDsResolverCatalog ( catalogCrDs , pdh ) ; } catch ( IOException e ) { log . error ( "makeProxyDsResolverCatalog(): catalog generation failed <" + catalogCrDs . getPath ( ) + ">: " + e . getMessage ( ) ) ; return null ; } // Set the catalog base URI. if ( catalog != null ) catalog . setBaseURI ( baseURI ) ; return catalog ; }
Try to build a catalog for the given resolver path by scanning the
location associated with this InvDatasetScan. The given path must start
with the path of this InvDatasetScan and refer to a resolver
ProxyDatasetHandler that is part of this InvDatasetScan.

@param path the part of the baseURI that is the path
@param baseURI the base URL for the catalog, used to resolve relative URLs.

@return the resolver catalog for this path (uses version 1.1) or null if build unsuccessful.
Try to build a catalog for the given resolver path by scanning the location associated with this InvDatasetScan . The given path must start with the path of this InvDatasetScan and refer to a resolver ProxyDatasetHandler that is part of this InvDatasetScan .