legacy/src/main/java/thredds/cataloggen/config/DodsDirDatasetSource.java
protected InvCatalog createSkeletonCatalog( String prefixUrlPath ) throws IOException
  {
    String aphString = this.getResultService().getAccessPointHeader();
    String apString = this.getAccessPoint();

    // Check that accessPoint URL starts with accessPointHeader.
    if ( ! apString.startsWith( aphString))
      throw new IOException( "The accessPoint <" + apString + "> must start with the accessPointHeader <" + aphString + ">.");

    // Check that accessPoint URL ends with a slash ("/").
    if ( ! apString.endsWith( "/")) throw new IOException( "The accessPoint URL must end with a \"/\" <" + apString + ">.");

    // Check that accessPoint URL is an OPeNDAP server URL.
    String apVersionString = apString + "version";
    String apVersionResultContent = null;
    try
    {
      apVersionResultContent = urlExtractor.getTextContent( apVersionString);
    }
    catch (java.io.IOException e)
    {
      String tmpMsg = "The accessPoint URL is not an OPeNDAP server URL (no version info) <" + apVersionString + ">";
      log.error( "expandThisType(): " + tmpMsg, e);
      IOException myE = new IOException( tmpMsg + e.getMessage());
      myE.initCause( e);
      throw( myE);
    }
    if ( apVersionResultContent.indexOf( "DODS") == -1 &&
         apVersionResultContent.indexOf( "OPeNDAP") == -1 &&
         apVersionResultContent.indexOf( "DAP") == -1)
    {
      String tmpMsg = "The accessPoint URL version info is not valid <" + apVersionResultContent + ">";
      log.error(  "expandThisType(): " + tmpMsg);
      throw new IOException( tmpMsg);
    }

    // Some setup stuff
    try
    {
      accessPointHeaderUri = new URI( aphString);
    }
    catch ( URISyntaxException e )
    {
      throw new IOException("The accessPointHeader URL failed to map to a URI <" + aphString + ">.");
    }

    // Create catalog.
    InvCatalogImpl catalog = new InvCatalogImpl( null, null, null );
                                                 //this.getName(), null, null);

    // Create service.
    InvService service = new InvService( this.getResultService().getName(),
                                         this.getResultService().getServiceType().toString(),
                                         this.getResultService().getBase(),
                                         this.getResultService().getSuffix(),
                                         this.getResultService().getDescription());
    for ( Iterator it = this.getResultService().getProperties().iterator(); it.hasNext(); )
    {
      service.addProperty( (InvProperty) it.next() );
    }
    for ( Iterator it = this.getResultService().getServices().iterator(); it.hasNext(); )
    {
      service.addService( (InvService) it.next() );
    }

    // Add service to catalog.
    catalog.addService( service);

    // Create top-level dataset.
    DodsDirInvDataset topDs = null;
    try
    {
      topDs = new DodsDirInvDataset( null, new URI( apString));
    }
    catch ( URISyntaxException e )
    {
      throw new IOException("The accessPoint URL failed to map to a URI <" + apString + ">.");
    }

    // Set the serviceName (inherited by all datasets) in top-level dataset.
    ThreddsMetadata tm = new ThreddsMetadata( false);
    tm.setServiceName( service.getName());
    InvMetadata md = new InvMetadata( topDs, null, XMLEntityResolver.CATALOG_NAMESPACE_10, "", true, true, null, tm);
    ThreddsMetadata tm2 = new ThreddsMetadata( false);
    tm2.addMetadata( md);
    topDs.setLocalMetadata(tm2);

    // Add top-level dataset to catalog.
    catalog.addDataset( topDs);

    // Tie up any loose ends in catalog with finish().
    ((InvCatalogImpl) catalog).finish();

    return( catalog);
  }
protected InvCatalog createSkeletonCatalog( String prefixUrlPath ) throws IOException
  {
    String aphString = this.getResultService().getAccessPointHeader();
    String apString = this.getAccessPoint();

    // Check that accessPoint URL starts with accessPointHeader.
    if ( ! apString.startsWith( aphString))
      throw new IOException( "The accessPoint <" + apString + "> must start with the accessPointHeader <" + aphString + ">.");

    // Check that accessPoint URL ends with a slash ("/").
    if ( ! apString.endsWith( "/")) throw new IOException( "The accessPoint URL must end with a \"/\" <" + apString + ">.");

    // Check that accessPoint URL is an OPeNDAP server URL.
    String apVersionString = apString + "version";
    String apVersionResultContent = null;
    try
    {
      apVersionResultContent = urlExtractor.getTextContent( apVersionString);
    }
    catch (java.io.IOException e)
    {
      String tmpMsg = "The accessPoint URL is not an OPeNDAP server URL (no version info) <" + apVersionString + ">";
      log.error( "expandThisType(): " + tmpMsg, e);
      IOException myE = new IOException( tmpMsg + e.getMessage());
      myE.initCause( e);
      throw( myE);
    }
    if ( apVersionResultContent.indexOf( "DODS") == -1 &&
         apVersionResultContent.indexOf( "OPeNDAP") == -1 &&
         apVersionResultContent.indexOf( "DAP") == -1)
    {
      String tmpMsg = "The accessPoint URL version info is not valid <" + apVersionResultContent + ">";
      log.error(  "expandThisType(): " + tmpMsg);
      throw new IOException( tmpMsg);
    }

    // Some setup stuff
    try
    {
      accessPointHeaderUri = new URI( aphString);
    }
    catch ( URISyntaxException e )
    {
      throw new IOException("The accessPointHeader URL failed to map to a URI <" + aphString + ">.");
    }

    // Create catalog.
    InvCatalogImpl catalog = new InvCatalogImpl( null, null, null );
                                                 //this.getName(), null, null);

    // Create service.
    InvService service = new InvService( this.getResultService().getName(),
                                         this.getResultService().getServiceType().toString(),
                                         this.getResultService().getBase(),
                                         this.getResultService().getSuffix(),
                                         this.getResultService().getDescription());
    for ( Iterator it = this.getResultService().getProperties().iterator(); it.hasNext(); )
    {
      service.addProperty( (InvProperty) it.next() );
    }
    for ( Iterator it = this.getResultService().getServices().iterator(); it.hasNext(); )
    {
      service.addService( (InvService) it.next() );
    }

    // Add service to catalog.
    catalog.addService( service);

    // Create top-level dataset.
    DodsDirInvDataset topDs = null;
    try
    {
      topDs = new DodsDirInvDataset( null, new URI( apString));
    }
    catch ( URISyntaxException e )
    {
      throw new IOException("The accessPoint URL failed to map to a URI <" + apString + ">.");
    }

    // Set the serviceName (inherited by all datasets) in top-level dataset.
    ThreddsMetadata tm = new ThreddsMetadata( false);
    tm.setServiceName( service.getName());
    InvMetadata md = new InvMetadata( topDs, null, XMLEntityResolver.CATALOG_NAMESPACE_10, "", true, true, null, tm);
    ThreddsMetadata tm2 = new ThreddsMetadata( false);
    tm2.addMetadata( md);
    topDs.setLocalMetadata(tm2);

    // Add top-level dataset to catalog.
    catalog.addDataset( topDs);

    // Tie up any loose ends in catalog with finish().
    ((InvCatalogImpl) catalog).finish();

    return( catalog);
  }
protected InvCatalog createSkeletonCatalog ( String prefixUrlPath ) throws IOException { String aphString = this . getResultService ( ) . getAccessPointHeader ( ) ; String apString = this . getAccessPoint ( ) ; // Check that accessPoint URL starts with accessPointHeader. if ( ! apString . startsWith ( aphString ) ) throw new IOException ( "The accessPoint <" + apString + "> must start with the accessPointHeader <" + aphString + ">." ) ; // Check that accessPoint URL ends with a slash ("/"). if ( ! apString . endsWith ( "/" ) ) throw new IOException ( "The accessPoint URL must end with a \"/\" <" + apString + ">." ) ; // Check that accessPoint URL is an OPeNDAP server URL. String apVersionString = apString + "version" ; String apVersionResultContent = null ; try { apVersionResultContent = urlExtractor . getTextContent ( apVersionString ) ; } catch ( java . io . IOException e ) { String tmpMsg = "The accessPoint URL is not an OPeNDAP server URL (no version info) <" + apVersionString + ">" ; log . error ( "expandThisType(): " + tmpMsg , e ) ; IOException myE = new IOException ( tmpMsg + e . getMessage ( ) ) ; myE . initCause ( e ) ; throw ( myE ) ; } if ( apVersionResultContent . indexOf ( "DODS" ) == - 1 && apVersionResultContent . indexOf ( "OPeNDAP" ) == - 1 && apVersionResultContent . indexOf ( "DAP" ) == - 1 ) { String tmpMsg = "The accessPoint URL version info is not valid <" + apVersionResultContent + ">" ; log . error ( "expandThisType(): " + tmpMsg ) ; throw new IOException ( tmpMsg ) ; } // Some setup stuff try { accessPointHeaderUri = new URI ( aphString ) ; } catch ( URISyntaxException e ) { throw new IOException ( "The accessPointHeader URL failed to map to a URI <" + aphString + ">." ) ; } // Create catalog. InvCatalogImpl catalog = new InvCatalogImpl ( null , null , null ) ; //this.getName(), null, null); // Create service. InvService service = new InvService ( this . getResultService ( ) . getName ( ) , this . getResultService ( ) . getServiceType ( ) . toString ( ) , this . getResultService ( ) . getBase ( ) , this . getResultService ( ) . getSuffix ( ) , this . getResultService ( ) . getDescription ( ) ) ; for ( Iterator it = this . getResultService ( ) . getProperties ( ) . iterator ( ) ; it . hasNext ( ) ; ) { service . addProperty ( ( InvProperty ) it . next ( ) ) ; } for ( Iterator it = this . getResultService ( ) . getServices ( ) . iterator ( ) ; it . hasNext ( ) ; ) { service . addService ( ( InvService ) it . next ( ) ) ; } // Add service to catalog. catalog . addService ( service ) ; // Create top-level dataset. DodsDirInvDataset topDs = null ; try { topDs = new DodsDirInvDataset ( null , new URI ( apString ) ) ; } catch ( URISyntaxException e ) { throw new IOException ( "The accessPoint URL failed to map to a URI <" + apString + ">." ) ; } // Set the serviceName (inherited by all datasets) in top-level dataset. ThreddsMetadata tm = new ThreddsMetadata ( false ) ; tm . setServiceName ( service . getName ( ) ) ; InvMetadata md = new InvMetadata ( topDs , null , XMLEntityResolver . CATALOG_NAMESPACE_10 , "" , true , true , null , tm ) ; ThreddsMetadata tm2 = new ThreddsMetadata ( false ) ; tm2 . addMetadata ( md ) ; topDs . setLocalMetadata ( tm2 ) ; // Add top-level dataset to catalog. catalog . addDataset ( topDs ) ; // Tie up any loose ends in catalog with finish(). ( ( InvCatalogImpl ) catalog ) . finish ( ) ; return ( catalog ) ; }
Build an unnamed InvCatalog for this DatasetSource and return the
top-level InvDataset. The ResultService for this DatasetSource is
used to create the InvService for the new InvCatalog. Each InvDataset
in the catalog is named with the location of the object they represent
on the dataset source.

@return the top-level dataset of the newly constructed InvCatalog.

@throws java.io.IOException if top-level dataset does not exist or is not a collection dataset.
Build an unnamed InvCatalog for this DatasetSource and return the top - level InvDataset . The ResultService for this DatasetSource is used to create the InvService for the new InvCatalog . Each InvDataset in the catalog is named with the location of the object they represent on the dataset source .