private ConfigurationResourceProvider createResourceProvider( DefaultStorageFinder cacheDirFinder) throws ConfigurationException { return new XMLFileResourceProvider( CONFIGURATION_FILE_NAME, (org.springframework.web.context.WebApplicationContext) appContext, cacheDirFinder); }
/** * @param storageFinder used to get the location of the cache directory * @param contextProvider used to look up registered instances of {@link ExpirationPolicy} and * to aid in determining the location of the {@code geowebcache-diskquota.xml} configuration * file * @param tld used only to validate the presence of a layer at {@link #loadConfig()} and ignore * the layer quota definition if the {@link TileLayer} does not exist * @throws IOException */ public ConfigLoader( final DefaultStorageFinder storageFinder, final ApplicationContextProvider contextProvider, final TileLayerDispatcher tld) throws ConfigurationException { this( new XMLFileResourceProvider( CONFIGURATION_FILE_NAME, contextProvider, null, storageFinder), storageFinder, tld); }
/** * Constructor that will look for {@code geowebcache.xml} at the directory defined by {@code * storageDirFinder} * * @param appCtx use to lookup {@link XMLConfigurationProvider} extenions, may be {@code null} * @param storageDirFinder * @throws ConfigurationException */ public XMLConfiguration( final ApplicationContextProvider appCtx, final DefaultStorageFinder storageDirFinder) throws ConfigurationException { this( appCtx, new XMLFileResourceProvider( DEFAULT_CONFIGURATION_FILE_NAME, appCtx, storageDirFinder)); resourceProvider.setTemplate("/" + DEFAULT_CONFIGURATION_FILE_NAME); }
/** * File System based Constructor * * @param appCtx use to lookup {@link XMLConfigurationProvider} extensions, may be {@code null} * @param configFileDirectory * @param storageDirFinder * @throws ConfigurationException */ public XMLConfiguration( final ApplicationContextProvider appCtx, final String configFileDirectory, final DefaultStorageFinder storageDirFinder) throws ConfigurationException { this( appCtx, new XMLFileResourceProvider( DEFAULT_CONFIGURATION_FILE_NAME, appCtx, configFileDirectory, storageDirFinder)); resourceProvider.setTemplate("/" + DEFAULT_CONFIGURATION_FILE_NAME); }
protected ServerConfiguration getConfig() throws Exception { if (configFile == null) { // create a temp XML config configDir = temp.getRoot(); configFile = temp.newFile(XMLConfiguration.DEFAULT_CONFIGURATION_FILE_NAME); // copy the example XML to the temp config file URL source = XMLConfiguration.class.getResource("geowebcache_190.xml"); FileUtils.copyURLToFile(source, configFile); } // initialize the config with an XMLFileResourceProvider that uses the temp config file gridSetBroker = new GridSetBroker(true, true); ConfigurationResourceProvider configProvider = new XMLFileResourceProvider( XMLConfiguration.DEFAULT_CONFIGURATION_FILE_NAME, (WebApplicationContext) null, configDir.getAbsolutePath(), null); config = new XMLConfiguration(null, configProvider); ((XMLConfiguration) config).setGridSetBroker(gridSetBroker); config.afterPropertiesSet(); return config; } }