Package org.geoserver.config.util

Examples of org.geoserver.config.util.XStreamPersister.save()


                p.setCatalog( catalog );
                p.setReferenceByName(true);
                p.setExcludeIds();
               
                configurePersister(p,this);
                p.save( data, output );
            }
           
            @Override
            protected Object read(InputStream in)
                    throws IOException {
View Full Code Here


                p.setCatalog(catalog);
                p.setReferenceByName(true);
                p.setExcludeIds();
               
                configurePersister(p,this);
                p.save( data, output );
            }
           
            @Override
            protected Object read(InputStream input)
                    throws IOException {
View Full Code Here

        //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" );
View Full Code Here

                    protected Component getContents(String id) {
                        XStreamPersister xp = importer()
                                .createXStreamPersisterXML();
                        ByteArrayOutputStream bout = new ByteArrayOutputStream();
                        try {
                            xp.save(model.getObject(), bout);
                        } catch (IOException e) {
                            bout = new ByteArrayOutputStream();
                            LOGGER.log(Level.FINER, e.getMessage(), e);
                            e.printStackTrace(new PrintWriter(bout));
                        }
View Full Code Here

    void toJSON(Object o, OutputStream out, Callback callback) throws IOException {
        XStreamPersister xp = persister();
        if (callback != null) {
            xp.setCallback(callback);
        }
        xp.save(o, out);
        out.flush();
    }

    XStreamPersister persister() {
        XStreamPersister xp =
View Full Code Here

                p.setCatalog( catalog );
                p.setReferenceByName(true);
                p.setExcludeIds();
               
                configurePersister(p,this);
                p.save( data, output );
            }
           
            @Override
            protected Object read(InputStream in)
                    throws IOException {
View Full Code Here

                p.setCatalog(catalog);
                p.setReferenceByName(true);
                p.setExcludeIds();
               
                configurePersister(p,this);
                p.save( data, output );
            }
           
            @Override
            protected Object read(InputStream input)
                    throws IOException {
View Full Code Here

        File tmp = new File(getConfigRoot(), GWC_CONFIG_FILE + ".tmp");
        XStreamPersister xmlPersister = this.persisterFactory.createXMLPersister();
        configureXstream(xmlPersister.getXStream());
        OutputStream out = new FileOutputStream(tmp);
        try {
            xmlPersister.save(config, out);
        } finally {
            out.close();
        }
        File configFile = new File(getConfigRoot(), GWC_CONFIG_FILE);
        IOUtils.rename(tmp, configFile);
View Full Code Here

   
    protected Document marshallToXML(DimensionInfo di) throws Exception{
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        XStreamPersisterFactory xpf = GeoServerExtensions.bean(XStreamPersisterFactory.class);
        XStreamPersister persister = xpf.createXMLPersister();
        persister.save(di, baos);
        baos.flush();
        DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();       
        DocumentBuilder builder = factory.newDocumentBuilder();
        return builder.parse(new ByteArrayInputStream(baos.toByteArray()));
    }
View Full Code Here

                p.setCatalog( catalog );
                p.setReferenceByName(true);
                p.setExcludeIds();
               
                configurePersister(p,this);
                p.save( data, output );
            }
           
            @Override
            protected Object read(InputStream in)
                    throws IOException {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.