//TODO: kill this method, it is not longer needed since persistance is event based
public void persist() throws Exception {
//TODO: make the configuration backend pluggable... or loadable
// from application context, or web.xml, or env variable, etc...
XStreamPersister p = xpf.createXMLPersister();
BufferedOutputStream out = new BufferedOutputStream(
new FileOutputStream( resourceLoader.createFile( "catalog2.xml" ) )
);
//persist catalog
Catalog catalog = geoserver.getCatalog();
if( catalog instanceof Wrapper ) {
catalog = ((Wrapper)catalog).unwrap( Catalog.class );
}
p.save( catalog, out );
out.flush();
out.close();
//persist resources
File workspaces = resourceLoader.findOrCreateDirectory( "workspaces" );