private void validateSavedConfig() throws SAXException, IOException, ConfigurationException, FileNotFoundException { try { XMLConfiguration.validate( XMLConfiguration.loadDocument(new FileInputStream(configFile))); } catch (SAXParseException e) { log.error(e.getMessage()); fail("Error validating from " + configFile + " " + e.getMessage()); } }
private GeoWebCacheConfiguration loadConfiguration(InputStream xmlFile) throws IOException, ConfigurationException { Node rootNode = loadDocument(xmlFile); XStream xs = getConfiguredXStreamWithContext(new GeoWebCacheXStream(), Context.PERSIST); GeoWebCacheConfiguration config; config = (GeoWebCacheConfiguration) xs.unmarshal(new DomReader((Element) rootNode)); return config; }
private XMLConfiguration loadConfig(String fileName) throws Exception { try (InputStream is = XMLConfiguration.class.getResourceAsStream(fileName); ) { Node root = XMLConfiguration.loadDocument(is); print(root.getOwnerDocument()); } XMLConfiguration xmlConfig = new XMLConfiguration( null, new MockConfigurationResourceProvider( () -> XMLConfiguration.class.getResourceAsStream(fileName))); GridSetBroker gsb = new GridSetBroker(Arrays.asList(new DefaultGridsets(true, true), xmlConfig)); xmlConfig.setGridSetBroker(gsb); xmlConfig.afterPropertiesSet(); Iterator<TileLayer> iter = xmlConfig.getLayers().iterator(); while (iter.hasNext()) { TileLayer layer = iter.next(); layer.initialize(gsb); } return xmlConfig; }
XMLConfiguration.loadDocument(new FileInputStream(configFile))); } catch (SAXParseException e) { log.error(e.getMessage());
XMLConfiguration.loadDocument(new FileInputStream(configFile))); } catch (SAXParseException e) { log.error(e.getMessage());
XMLConfiguration.loadDocument(new FileInputStream(configFile))); } catch (SAXParseException e) { log.error(e.getMessage());