protected InvDatasetFeatureCollection(InvDatasetImpl parent, String name, String path, FeatureCollectionType fcType, FeatureCollectionConfig config) {
super(parent, name, buildCatalogServiceHref( path) );
this.path = path;
this.fcType = fcType;
this.getLocalMetadataInheritable().setDataType(fcType.getFeatureType());
this.config = config;
if (config.gribConfig.latestNamer != null) {
this.latestFileName = config.gribConfig.latestNamer;
}
String collectionName = CollectionManagerAbstract.cleanName(config.name != null ? config.name : name);
config.name = collectionName;
this.logger = loggerFactory.getLogger("fc."+collectionName);
Formatter errlog = new Formatter();
if (config.spec.startsWith(MFileCollectionManager.CATALOG)) {
dcm = new CatalogCollectionManager(config.spec);
} else {
dcm = new MFileCollectionManager(config, errlog, this.logger);
}
topDirectory = dcm.getRoot();
this.logger.info("FeatureCollection added = {}", getConfig());
String errs = errlog.toString();
if (errs.length()> 0) logger.warn("MFileCollectionManager parse error = {} ", errs);
}