Package org.geoserver.platform.resource

Examples of org.geoserver.platform.resource.Resource.lock()


        ProxyConfig retval;
        Resource.Lock lock = null;
        try {
            GeoServerResourceLoader loader = GeoServerExtensions.bean(GeoServerResourceLoader.class);
            Resource configFile = loader.get( "proxy/proxy.xml" );
            lock = configFile.lock();
           
            InputStream proxyConfStream = configFile.in();
            XStream xs = new XStream();
            //Take the read lock, then read the file
            retval = (ProxyConfig) (xs.fromXML(proxyConfStream));
View Full Code Here


           
            XStream xs = new XStream();
            String xml = xs.toXML(pc);
            FileWriter fw = new FileWriter(configFile.file(), false); // false means overwrite old file
            //Take the write lock on the file & lock it
            lock = configFile.lock();
            fw.write(xml);
            fw.close();
            return true;
        } catch (Exception e) {
            LOG.warning("Failed to save configuration for Proxy module. Exception:"
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.