cdm/src/main/java/thredds/featurecollection/FeatureCollectionConfigBuilder.java
public FeatureCollectionConfig readConfigFromCatalog(String catalogAndPath) {
    String catFilename;
    String fcName = null;

    int pos = catalogAndPath.indexOf("#");
    if (pos > 0) {
      catFilename = catalogAndPath.substring(0, pos);
      fcName = catalogAndPath.substring(pos + 1);
    } else {
      catFilename = catalogAndPath;
    }

    File cat = new File(catFilename);
    org.jdom2.Document doc;
    try {
      SAXBuilder builder = new SAXBuilder();
      doc = builder.build(cat);
    } catch (Exception e) {
      e.printStackTrace();
      return null;
    }

    try {
      List<Element> fcElems = new ArrayList<>();
      findFeatureCollection(doc.getRootElement(), fcName, fcElems);
      if (fcElems.size() > 0)
        return readConfig(fcElems.get(0));

    } catch (IllegalStateException e) {
      e.printStackTrace();
    }

    return null;
  }
public FeatureCollectionConfig readConfigFromCatalog(String catalogAndPath) {
    String catFilename;
    String fcName = null;

    int pos = catalogAndPath.indexOf("#");
    if (pos > 0) {
      catFilename = catalogAndPath.substring(0, pos);
      fcName = catalogAndPath.substring(pos + 1);
    } else {
      catFilename = catalogAndPath;
    }

    File cat = new File(catFilename);
    org.jdom2.Document doc;
    try {
      SAXBuilder builder = new SAXBuilder();
      doc = builder.build(cat);
    } catch (Exception e) {
      e.printStackTrace();
      return null;
    }

    try {
      List<Element> fcElems = new ArrayList<>();
      findFeatureCollection(doc.getRootElement(), fcName, fcElems);
      if (fcElems.size() > 0)
        return readConfig(fcElems.get(0));

    } catch (IllegalStateException e) {
      e.printStackTrace();
    }

    return null;
  }
public FeatureCollectionConfig readConfigFromCatalog ( String catalogAndPath ) { String catFilename ; String fcName = null ; int pos = catalogAndPath . indexOf ( "#" ) ; if ( pos > 0 ) { catFilename = catalogAndPath . substring ( 0 , pos ) ; fcName = catalogAndPath . substring ( pos + 1 ) ; } else { catFilename = catalogAndPath ; } File cat = new File ( catFilename ) ; org . jdom2 . Document doc ; try { SAXBuilder builder = new SAXBuilder ( ) ; doc = builder . build ( cat ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; return null ; } try { List < Element > fcElems = new ArrayList <> ( ) ; findFeatureCollection ( doc . getRootElement ( ) , fcName , fcElems ) ; if ( fcElems . size ( ) > 0 ) return readConfig ( fcElems . get ( 0 ) ) ; } catch ( IllegalStateException e ) { e . printStackTrace ( ) ; } return null ; }
Read a catalog and extract a FeatureCollectionConfig from it

@param catalogAndPath catalog filename, or catalog#featureName
@return FeatureCollectionConfig or null
Read a catalog and extract a FeatureCollectionConfig from it