writer.close(); WorkspaceUtils.activateSynthetic( workspace, LayerStoreProvider.class, id, new String( bos.toByteArray(), Charset.forName( "UTF-8" ) ) );
public void transform() throws TransformerException, XMLStreamException { OwsManager mgr = workspace.getResourceManager( OwsManager.class ); List<OWS> wmss = mgr.getByOWSClass( WMSController.class ); for ( OWS ows : wmss ) { ResourceMetadata<? extends Resource> md = ows.getMetadata(); ResourceIdentifier<? extends Resource> id = md.getIdentifier(); File loc = md.getLocation().resolveToFile( id.getId() + ".xml" ); ByteArrayOutputStream bos = new ByteArrayOutputStream(); transformer.transform( new StreamSource( loc ), new StreamResult( bos ) ); ThemeXmlStreamEncoder.writeOut( bos ); WorkspaceUtils.activateSynthetic( workspace, ThemeProvider.class, id.getId(), new String( bos.toByteArray(), Charset.forName( "UTF-8" ) ) ); } }