Package org.geoserver.platform

Examples of org.geoserver.platform.GeoServerResourceLoader


        assertEquals( "default_polygon.sld", polygon.getFilename() );
    }
   
    @Test
    public void testLoadNestedLayerGroups() throws Exception {
        GeoServerResourceLoader resources = GeoServerExtensions.bean(GeoServerResourceLoader.class );
        assertSame( catalog.getResourceLoader(), resources );
        loader.readCatalog(catalog, xp);
        assertNotNull(catalog.getLayerGroupByName("topp", "simplegroup"));
        LayerGroupInfo nestedLayerGroup = catalog.getLayerGroupByName("topp", "nestedgroup");
        assertNotNull(nestedLayerGroup);
View Full Code Here


        URL url = null;

        try {
            url = new URL(imageURL);
            if (url.getProtocol() == null || url.getProtocol().equals("file")) {
                GeoServerResourceLoader loader = GeoServerExtensions.bean(GeoServerResourceLoader.class);
                File file = loader.url(imageURL);
                if (file.exists()){
                    url = DataUtilities.fileToURL(file);
                }
            }
        } catch (MalformedURLException e) {
View Full Code Here

    @Override
    protected void onSetUp(SystemTestData testData) throws Exception {
        super.onSetUp(testData);
   
        GeoServerResourceLoader loader1 =  getResourceLoader();
        GeoServerResourceLoader loader2 = GeoServerExtensions.bean(GeoServerResourceLoader.class);
       
        // setup the grid file, the definitions and the tx overrides
        new File(testData.getDataDirectoryRoot(), "user_projections").mkdir();
        testData.copyTo(OvverideTransformationsTest.class.getResourceAsStream("test_epsg.properties"), "user_projections/epsg.properties");
        testData.copyTo(OvverideTransformationsTest.class.getResourceAsStream("test_epsg_operations.properties"), "user_projections/epsg_operations.properties");
View Full Code Here

            Logging.ALL.setLoggerFactory(Log4JLoggerFactory.getInstance());
        } catch (Exception e) {
            LOGGER.log(Level.SEVERE, "Could not configure log4j logging redirection", e);
        }
        System.setProperty(LoggingUtils.RELINQUISH_LOG4J_CONTROL, "true");
        GeoServerResourceLoader loader = new GeoServerResourceLoader(testData.getDataDirectoryRoot());
        LoggingUtils.configureGeoServerLogging(loader, getClass().getResourceAsStream(getLogConfiguration()), false, true, null);

        //HACK: once we port tests to the new data directory, remove this
        GeoServerLoader.setLegacy( useLegacyDataDirectory() );
View Full Code Here

     * Tests that folder for legend samples is created, if missing.
     * @throws Exception
     */
    @Test
    public void testCachedLegendURLFolderCreated() throws Exception {
        GeoServerResourceLoader loader = GeoServerExtensions.bean(GeoServerResourceLoader.class);
       
        File samplesFolder = new File(loader.getBaseDirectory().getAbsolutePath() + File.separator
                + LegendSampleImpl.LEGEND_SAMPLES_FOLDER);
        removeFileOrFolder(samplesFolder);
        TransformerBase tr = createTransformer();
        tr.setIndentation(2);
        Document dom = WMSTestSupport.transform(req, tr);
View Full Code Here

     * SLD is newer.
     * @throws Exception
     */
    @Test
    public void testCachedLegendURLUpdatedSize() throws Exception {
        GeoServerResourceLoader loader = GeoServerExtensions.bean(GeoServerResourceLoader.class);
        Resource sldResource = loader.get(Paths.path("styles", "Bridges.sld"));
        File sampleFile = getSampleFile("Bridges");
       
        long lastTime = sampleFile.lastModified();
        long lastLength = sampleFile.length();
        long previousTime = sldResource.lastmodified();
View Full Code Here

     * SLD is newer (using Catalog events).
     * @throws Exception
     */
    @Test
    public void testCachedLegendURLUpdatedSize2() throws Exception {
        GeoServerResourceLoader loader = GeoServerExtensions.bean(GeoServerResourceLoader.class);
        Resource sldResource = loader.get(Paths.path("styles", "Bridges.sld"));
        File sampleFile = getSampleFile("Bridges");
       
        long lastTime = sampleFile.lastModified();
        long lastLength = sampleFile.length();
        long previousTime = sldResource.lastmodified();
View Full Code Here

        tester.assertComponent("form:name", TextField.class);
        tester.assertComponent("form:styleEditor:editorContainer:editorParent:editor", TextArea.class);
       
        tester.assertModelValue("form:name", "Buildings");
       
        GeoServerResourceLoader loader = GeoServerExtensions.bean(GeoServerResourceLoader.class);
        assertNotNull( loader );
       
        String path = Paths.path("styles", Paths.convert(buildingsStyle.getFilename()));
        Resource styleFile = loader.get(path);
       
        DocumentBuilder db = DocumentBuilderFactory.newInstance().newDocumentBuilder();
        Document d1 = db.parse( styleFile.in() );

        //GEOS-3257, actually drag into xml and compare with xmlunit to avoid
View Full Code Here

     *
     * @deprecated use {@link #handleBinUpload(String, File, Request)}.
     */
    public static File handleBinUpload(String datasetName, String extension,
            Request request) throws IOException, ConfigurationException {
        GeoServerResourceLoader loader = GeoServerExtensions.bean(GeoServerResourceLoader.class);
        Resource data = loader.get("data");
       
        final File dir = data.dir(); // find or create
        return handleBinUpload( datasetName + "." + extension, null, dir, request );
    }
View Full Code Here

     * @deprecated use {@link #handleURLUpload(String, File, Request)}.
     */
    public static File handleURLUpload(String datasetName, String workSpace, String extension, Request request) throws IOException, ConfigurationException {
        // Get the dir where to write and create a file there
       
        GeoServerResourceLoader loader = GeoServerExtensions.bean(GeoServerResourceLoader.class);
        Resource data = loader.get("data");
        final File dir = data.dir(); // find or create
        return handleURLUpload(datasetName + "." + extension, workSpace, dir, request);
    }
View Full Code Here

TOP

Related Classes of org.geoserver.platform.GeoServerResourceLoader

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.