if (beans.size() > 0) {
catalog = GranuleCatalogFactory.createGranuleCatalog(sourceURL, beans.get(0).getCatalogConfigurationBean(), params, getHints());
} else {
catalog = CatalogManager.createGranuleCatalogFromDatastore(parent, datastoreProperties, true, getHints());
}
MultiLevelROIProvider rois = MultiLevelROIProviderFactory.createFootprintProvider(parent);
catalog.setMultiScaleROIProvider(rois);
if (granuleCatalog != null) {
granuleCatalog.dispose();
}
granuleCatalog = catalog;
if (granuleCatalog == null) {
throw new DataSourceException("Unable to create index for this URL " + sourceURL);
}
// Creating a RasterManager for each mosaic configuration found on disk
for (MosaicConfigurationBean bean : beans) {
// Add a RasterManager on top of this Mosaic configuration bean and initialize it
addRasterManager(bean, true);
}
} else {
// Old style code: we have a single MosaicConfigurationBean. Use that to create the catalog
granuleCatalog = CatalogManager.createCatalog(sourceURL, configuration, this.hints);
File parent = DataUtilities.urlToFile(sourceURL).getParentFile();
MultiLevelROIProvider rois = MultiLevelROIProviderFactory.createFootprintProvider(parent);
granuleCatalog.setMultiScaleROIProvider(rois);
addRasterManager(configuration, true);
}
} catch (Throwable e) {