Package org.geoserver.platform

Examples of org.geoserver.platform.GeoServerResourceLoader.find()


        Catalog cat = getCatalog();
        assertNotNull(cat.getStyleByName("gs", "foo"));

        GeoServerResourceLoader rl = getResourceLoader();
        assertNotNull(rl.find("workspaces", "gs", "styles", "foo.sld"));
       
        MockHttpServletResponse response = deleteAsServletResponse("/rest/workspaces/gs/styles/foo?purge=true");
        assertEquals(200, response.getStatusCode());

        assertNull(cat.getStyleByName("gs", "foo"));
View Full Code Here


       
        MockHttpServletResponse response = deleteAsServletResponse("/rest/workspaces/gs/styles/foo?purge=true");
        assertEquals(200, response.getStatusCode());

        assertNull(cat.getStyleByName("gs", "foo"));
        assertNull(rl.find("workspaces", "gs", "styles", "foo.sld"));
    }

    @Test
    public void testGetAllByLayer() throws Exception {
        Document dom = getAsDOM( "/rest/layers/cite:BasicPolygons/styles.xml");
View Full Code Here

        // search for *LOGGING.properties files in the data directory
        GeoServerResourceLoader loader = GeoServerApplication.get().getBeanOfType(
                GeoServerResourceLoader.class);
        List<String> logProfiles = null;
        try {
            File logsDirectory = loader.find("logs");
            if(logsDirectory.exists() && logsDirectory.isDirectory()) {
                String[] propFiles = logsDirectory.list(new FilenameFilter() {
                   
                    public boolean accept(File dir, String name) {
                        return name.toLowerCase().endsWith("logging.properties");
View Full Code Here

        if (LOGGER.isLoggable(Level.FINE)) {
            LOGGER.log(Level.FINE, "Checking properties file");
        }
        File properties = null;
        try {
            properties = loader.find(PROPERTYFILENAME);
        } catch (IOException e) {
            if (LOGGER.isLoggable(Level.WARNING)) {
                LOGGER.log(Level.WARNING, e.getMessage(), e);
            }
        }
View Full Code Here

        try {
            // This is a temporary meassure until we fully implement ESRI WKT support in GeoTools.
            // See discussion in GEOS-4503
            GeoServerResourceLoader resourceLoader = GeoServerExtensions
                    .bean(GeoServerResourceLoader.class);
            File esriProjs = resourceLoader.find("user_projections", "esri.properties");
            if (null == esriProjs) {
                defaultPrjFormat.setEnabled(false);
                defaultPrjFormat.getModel().setObject(Boolean.FALSE);
                defaultPrjFormat.add(new AttributeModifier("title", true, new Model(
                        "No esri.properties file "
View Full Code Here

                            "styles"+
                            File.separator+
                            sInfo.getFilename());
                   
                }else{
                    styleFile=loader.find("styles/" + sInfo.getFilename());
                }
                // checks
                if(!styleFile.exists()||!styleFile.canRead()||!styleFile.isFile()){
                    throw new IllegalStateException("Unable to find style for event: "+sInfo.toString());
                }
View Full Code Here

           
            //serialize the style out into the data directory
            GeoServerResourceLoader loader = catalog.getResourceLoader();
            File f;
            try {
                f = loader.find( "styles/" +  name + ".sld" );
            }
            catch (IOException e) {
                throw new RestletException( "Error looking up file", Status.SERVER_ERROR_INTERNAL, e );
            }
           
View Full Code Here

        try {
            // This is a temporary meassure until we fully implement ESRI WKT support in GeoTools.
            // See discussion in GEOS-4503
            GeoServerResourceLoader resourceLoader = GeoServerExtensions
                    .bean(GeoServerResourceLoader.class);
            File esriProjs = resourceLoader.find("user_projections", "esri.properties");
            if (null == esriProjs) {
                defaultPrjFormat.setEnabled(false);
                defaultPrjFormat.getModel().setObject(Boolean.FALSE);
                defaultPrjFormat.add(new AttributeModifier("title", true, new Model(
                        "No esri.properties file "
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.