Package org.geoserver.platform

Examples of org.geoserver.platform.GeoServerResourceLoader


    static Python py;
    static PythonFilterFunctionAdapter adapter;
   
    @BeforeClass
    public static void setUpData() throws Exception {
        GeoServerResourceLoader loader = new GeoServerResourceLoader(new File("target"));
        py = new Python(loader);
       
        File f = new File("target", "foo_function.py");
        FileUtils.copyURLToFile(PythonFilterFunctionAdapterTest.class.getResource("foo_function.py"), f);
        adapter = new PythonFilterFunctionAdapter(f, py);
View Full Code Here


    static Python py;
    static PythonDataStoreAdapter adapter;
   
    @BeforeClass
    public static void setUpData() throws Exception {
        GeoServerResourceLoader loader = new GeoServerResourceLoader(new File("target"));
        py = new Python(loader);
       
        File f = new File("target", "foo_process.py");
        FileUtils.copyURLToFile(PythonDataStoreAdapterTest.class.getResource("foo_datastore.py"), f);
        adapter = new PythonDataStoreAdapter(f, py);
View Full Code Here

        GradientColorMapGenerator generator = null;
        Resource xmlFile = null;
        if (!colorMap.startsWith(GradientColorMapGenerator.RGB_INLINEVALUE_MARKER)
                && !colorMap.startsWith(GradientColorMapGenerator.HEX_INLINEVALUE_MARKER)) {
           
            GeoServerResourceLoader loader = GeoServerExtensions.bean(GeoServerResourceLoader.class);
            colorMap = colorMap.replace('\\', '/');
           
            String path = Paths.path("styles", "ramps", colorMap + ".svg");
           
            xmlFile = loader.get( path );
            if( xmlFile.getType() != Type.RESOURCE ){
                throw new IllegalArgumentException(
                        "The specified colorMap do not exist in the styles/ramps folder\n"
                                + "Check that "
                                + path
View Full Code Here

   
    @BeforeClass
    public static void setUpData() throws Exception {
        DeleteDbFiles.execute("target", "foobar", true);
       
        GeoServerResourceLoader loader = new GeoServerResourceLoader(new File("target"));
        PythonInterpreter pi = new Python(loader).interpreter();
        pi.exec("from geoscript.workspace import H2");
        pi.exec("from geoscript.geom import Point");
        pi.exec("h2 = H2('foobar', 'target')");
        pi.exec("l = h2.create('bar', [('geom', Point, 'epsg:4326'), ('baz', str)])");
View Full Code Here

            IOUtils.closeQuietly(is);
        }

        URL style = getClass().getResource("test-data/style_rgb.sld");
       
        GeoServerResourceLoader loader = catalog.getResourceLoader();
        final String dataDir = loader.getBaseDirectory().getAbsolutePath();
        try {
            is = style.openStream();
            org.geoserver.data.util.IOUtils.copy(is, new File(dataDir + "/styles/style_rgb.sld"));
        } finally {
            IOUtils.closeQuietly(is);
View Full Code Here

    }
  }

  private List<String> getTileSets() throws IOException,
      ParserConfigurationException, SAXException {
    GeoServerResourceLoader resourceLoader = ((GeoServerApplication) getApplication())
        .getCatalog().getResourceLoader();
    File dir = resourceLoader.findOrCreateDirectory("tilesets");
    TileSetsParser tileSetsParser = new TileSetsParser(dir,
        ((GeoServerApplication) getApplication()).LOGGER);
    return tileSetsParser.getTileSetsNames();
  }
View Full Code Here

    return tileSetsParser.getTileSetsNames();
  }

  private List<String> getLODSets() throws IOException,
      ParserConfigurationException, SAXException {
    GeoServerResourceLoader resourceLoader = ((GeoServerApplication) getApplication())
        .getCatalog().getResourceLoader();
    File dir = resourceLoader.findOrCreateDirectory("lodsets");
    LODSetParser LODSetParser = new LODSetParser(dir,
        ((GeoServerApplication) getApplication()).LOGGER);
    return LODSetParser.getLodSetsNames();
  }
View Full Code Here

    }
   
    File getWpsOutputStorage() {
        File wpsStore = null;
        try {
            GeoServerResourceLoader loader = GeoServerExtensions.bean(GeoServerResourceLoader.class);
            Resource wps = loader.get("temp/wps");
            wpsStore = wps.dir(); // find or create
        } catch(Exception e) {
            throw new ServiceException("Could not create the temporary storage directory for WPS");
        }
        if(wpsStore == null || !wpsStore.exists()) {
View Full Code Here

     * @param geoserver
     * @throws IOException
     */
    public GeoServerInternalCatalogStore(GeoServer geoserver) throws IOException {
        super( geoserver.getCatalog());
        GeoServerResourceLoader loader = geoserver.getCatalog().getResourceLoader();
        File dir = loader.findOrCreateDirectory("csw");
        for (Name name : descriptorByType.keySet()) {
            String typeName = name.getLocalPart();
            File f = new File(dir, typeName + ".properties");

            PropertyFileWatcher watcher = new PropertyFileWatcher(f);
View Full Code Here

                    //
                    // Getting coverage reader using the format and the real path.
                    //
                    // /////////////////////////////////////////////////////////
                    final String url = info.getURL();
                    GeoServerResourceLoader loader = catalog.getResourceLoader();
                    final File obj = loader.url(url);

                    // In case no File is returned, provide the original String url
                    final Object input = obj != null ? obj : url; 

                    // readers might change the provided hints, pass down a defensive copy
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.