@Override protected void readCatalog(Catalog catalog, XStreamPersister xp) throws Exception { catalog.setResourceLoader(resourceLoader); // look for legacy catalog.xml File f = resourceLoader.find("catalog.xml"); if (f != null) { LegacyCatalogImporter catalogImporter = new LegacyCatalogImporter(); catalogImporter.setResourceLoader(resourceLoader); catalogImporter.setCatalog(catalog); catalogImporter.imprt(resourceLoader.getBaseDirectory()); } else { LOGGER.warning("No catalog file found."); } }
void importCatalog(File catalogFile) throws FileNotFoundException, IOException, Exception { CatalogFactory factory = catalog.getFactory(); LegacyCatalogReader reader = new LegacyCatalogReader(); reader.read(Files.asResource(catalogFile)); // build all the catalog objects that can be read from the catalog.xml file importNamespaces(factory, reader.namespaces(), false); importNamespaces(factory, reader.isolatedNamespaces(), true); importStyles(factory, reader.styles()); importDataStores(factory, reader.dataStores()); importFormats(factory, reader.formats()); }
public void testMissingFeatureTypes() throws Exception { MockData mockData = (MockData) getTestData(); mockData.getFeatureTypesDirectory().delete(); LegacyCatalogImporter importer = new LegacyCatalogImporter(new CatalogImpl()); importer.imprt(mockData.getDataDirectoryRoot()); }
LegacyCatalogImporter importer = new LegacyCatalogImporter(catalog2); importer.setResourceLoader(resourceLoader); importer.imprt(resourceLoader.getBaseDirectory());
"Could not find catalog.xml under:" + dir.getAbsolutePath()); importCatalog(catalogFile); try { ftInfoReader.read(Files.asResource(ftInfoFile)); FeatureTypeInfo featureType = readFeatureType(ftInfoReader, featureTypeDirectory); if (featureType == null) { continue; cInfoReader.read(cInfoFile); CoverageInfo coverage = readCoverage(cInfoReader); if (coverage == null) { continue;
/** * Imports namespaces and create symmetric workspaces for them * * @param factory * @param namespaces */ void importNamespaces(CatalogFactory factory, Map namespaces) { importNamespaces(factory, namespaces, false); }
public void testMissingCoverages() throws Exception { MockData mockData = (MockData) getTestData(); mockData.getCoveragesDirectory().delete(); LegacyCatalogImporter importer = new LegacyCatalogImporter(new CatalogImpl()); importer.imprt(mockData.getDataDirectoryRoot()); }
/** * As per GEOS-3513, make sure the old SRS codes are imported by adding the EPSG: prefix where * needed */ public void testCRSPrefix() throws Exception { MockData mockData = (MockData) getTestData(); mockData.getCoveragesDirectory().delete(); Catalog catalog = new CatalogImpl(); LegacyCatalogImporter importer = new LegacyCatalogImporter(catalog); File dataDirectoryRoot = mockData.getDataDirectoryRoot(); importer.imprt(dataDirectoryRoot); FeatureTypeInfo typeInfo = catalog.getFeatureTypeByName(typeName.getNamespaceURI(), typeName.getLocalPart()); assertEquals("EPSG:4326", typeInfo.getSRS()); } }