List of usage examples for org.apache.wicket.resource PropertiesFactory PropertiesFactory
public PropertiesFactory(final IPropertiesFactoryContext context)
From source file:org.geoserver.wicket.test.WicketTestApplication.java
License:Open Source License
@Override protected void init() { //JD: override some resource settings to allow for custom i18n lookups getResourceSettings().setResourceStreamLocator(new GeoServerResourceStreamLocator()); getResourceSettings().addStringResourceLoader(new GeoServerStringResourceLoader()); getResourceSettings().addStringResourceLoader(new ComponentStringResourceLoader()); getResourceSettings().addStringResourceLoader(new ClassStringResourceLoader(this.getClass())); getResourceSettings().setPropertiesFactory(new PropertiesFactory(this) { @Override// w w w . j a va 2s .co m public Properties load(Class clazz, String path) { if (clazz == WicketTestApplication.class && path.startsWith(wtapath)) { String newPath = path.replace(wtapath, gsapath); return super.load(GeoServerApplication.class, newPath); } return super.load(clazz, path); } }); }