Package org.geoserver.config

Examples of org.geoserver.config.GeoServerDataDirectory


    @Test
    public void testRemoteType() throws Exception {
        SimpleFeatureType ft =
            DataUtilities.createType("remoteType", "the_geom:MultiPolygon,FID:String,ADDRESS:String");

        GeoServerDataDirectory dd = createDataDirectoryMock();
        Catalog cat = createNiceMock(Catalog.class);
        expect(cat.getFeatureTypeByName(ft.getName())).andReturn(null).once();
        replay(dd, cat);
       
        GeoServerTemplateLoader tl = new GeoServerTemplateLoader(getClass(), dd);
View Full Code Here


        StyledLayerDescriptor sld = Styles.sld(style);
        handler.encode(sld, version, prettyPrint, out);
    }

    void copyFromFile(StyleInfo style, OutputStream out) throws IOException {
        GeoServerDataDirectory dd = GeoServerExtensions.bean(GeoServerDataDirectory.class);
        Resource resource = dd.style(style);
        InputStream in = resource.in();
        try {
            IOUtils.copy(in, out);
        }
        finally {
View Full Code Here

                        // directory
                        File file = DataUtilities.urlToFile(graphic.getLocation());
                        File styles = null;
                        File graphicFile = null;
                        if(file.isAbsolute()) {
                            GeoServerDataDirectory dataDir = (GeoServerDataDirectory) GeoServerExtensions.bean("dataDirectory");
                            // we grab the canonical path to make sure we can compare them, no relative parts in them and so on
                            styles = dataDir.findOrCreateStyleDir().getCanonicalFile();
                            graphicFile = file.getCanonicalFile();
                            file = graphicFile;
                            if(file.getAbsolutePath().startsWith(styles.getAbsolutePath())) {
                                // ok, part of the styles directory, extract only the relative path
                                file = new File(file.getAbsolutePath().substring(styles.getAbsolutePath().length() + 1));
View Full Code Here

TOP

Related Classes of org.geoserver.config.GeoServerDataDirectory

Copyright © 2018 www.massapicom. 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.