public EntityResolver getEntityResolver() { if (geoServer != null) { Boolean externalEntitiesEnabled = geoServer.getGlobal().isXmlExternalEntitiesEnabled(); if (externalEntitiesEnabled != null && externalEntitiesEnabled) { // XML parser will try to resolve entities return null; } } return entityResolver; } }
/** * Returns the mime type that should be exposed to the client when sending the exception * message. * * <p>Defaults to <code>geoserver.getMimeType()</code> */ public String getMimeType(GeoServer geoserver) { return "text/xml; charset=" + geoserver.getSettings().getCharset(); } }
@Override public void initialize(GeoServer geoServer) throws Exception { // Consider moving earlier to make use of the requested LockProvider during initial // configuration String lockProviderName = geoServer.getGlobal().getLockProviderName(); setLockProvider(lockProviderName); geoServer.addListener(listener); }
synchronized void incrementSequence() { // prevent infinite loop on configuration update if (updating) return; try { updating = true; GeoServerInfo gsInfo = geoServer.getGlobal(); gsInfo.setUpdateSequence(gsInfo.getUpdateSequence() + 1); geoServer.save(gsInfo); } finally { updating = false; } }
@Override public void initialize(GeoServer geoServer) throws Exception { loader.initializeDefaultStyles(geoServer.getCatalog()); } }
/** * Constructs the template loader. * * @param caller The "calling" class, used to look up templates based with {@link * Class#getResource(String)}, may be <code>null</code> * @param rl The geoserver resource loader * @throws IOException */ public GeoServerTemplateLoader(Class caller, GeoServerResourceLoader rl) throws IOException { this(caller, new GeoServerDataDirectory(rl)); }
@Override protected void onSetUp(SystemTestData testData) throws Exception { GeoServer geoServer = getGeoServer(); geoServer.addListener( new ServicePersister( (List) Arrays.asList(new ServiceLoader(getResourceLoader())), geoServer)); }
public DefaultGeoServerFacade(GeoServer geoServer) { this.geoServer = geoServer; this.global = geoServer.getFactory().createGlobal(); this.logging = geoServer.getFactory().createLogging(); }
protected void loadCatalog(Catalog catalog, XStreamPersister xp) throws Exception { catalog.setResourceLoader(resourceLoader); readCatalog(catalog, xp); if (!legacy) { // add the listener which will persist changes catalog.addListener(new GeoServerConfigPersister(resourceLoader, xp)); catalog.addListener(new GeoServerResourcePersister(catalog.getResourceLoader())); } }
@Override protected void initializeStyles(Catalog catalog, XStreamPersister xp) throws IOException { // add a persister temporarily in case the styles don't exist on disk GeoServerConfigPersister cp = new GeoServerConfigPersister(resourceLoader, xp); GeoServerResourcePersister rp = new GeoServerResourcePersister(resourceLoader); catalog.addListener(cp); catalog.addListener(rp); super.initializeStyles(catalog, xp); catalog.removeListener(cp); catalog.removeListener(rp); } }
public void reload() throws Exception { if (loader != null) { loader.reload(); } }
@Override public Response responseDispatched( Request request, Operation operation, Object result, Response response) { if (handleCachingHeaders(request)) { return new RevalidateTagResponse(response); } return response; }
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { this.loader = lookupGeoServerLoader(applicationContext); loader.setApplicationContext(applicationContext); }
private GeoServerPropertyOverrideConfigurer getOverriderForPath(String dataDirectoryPath) { GeoServerDataDirectory dataDirectory = createGeoServerDataDirectoryMock(dataDirectoryPath); return new GeoServerPropertyOverrideConfigurer(dataDirectory); }
public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException { if (loader != null) { return loader.postProcessBeforeInitialization(bean, beanName); } return bean; }
public void destroy() throws Exception { if (loader != null) { loader.destroy(); } }
@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + corePoolSize; result = prime * result + (int) (imageIOCacheThreshold ^ (imageIOCacheThreshold >>> 32)); result = prime * result + keepAliveTime; result = prime * result + maxPoolSize; result = prime * result + ((queueType == null) ? 0 : queueType.hashCode()); return result; }
/** * Performs initialization of GeoServer configuration, as well as any actions that should be * performed only when reloading the configuration. * * @param geoServer * @throws Exception */ default void reinitialize(GeoServer geoServer) throws Exception { initialize(geoServer); }; }
/** * Does some post processing on the catalog to ensure that the "well-known" styles are always * around. */ protected void initializeStyles(Catalog catalog, XStreamPersister xp) throws IOException { initializeDefaultStyles(catalog); }
@Override protected GeoServerLoader lookupGeoServerLoader(ApplicationContext appContext) { return new LegacyGeoServerLoader(resourceLoader); } }