Examples of GeoServerResourceLoader


Examples of org.geoserver.platform.GeoServerResourceLoader

    protected PythonInterpreter pi;
    protected ByteArrayOutputStream out;
   
    @BeforeClass
    public static void setUpPython() throws Exception {
        GeoServerResourceLoader loader = new GeoServerResourceLoader(new File("target"));
       
        python = new Python(loader);
        GeoserverDataDirectory.setResourceLoader(loader);
    }
View Full Code Here

Examples of org.geoserver.platform.GeoServerResourceLoader

    static Python py;
    static PythonMapFormatAdapter 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_mapformat.py");
        FileUtils.copyURLToFile(PythonVectorFormatAdapterTest.class.getResource("foo_mapformat.py"), f);
        adapter = new PythonMapFormatAdapter(f, py);
View Full Code Here

Examples of org.geoserver.platform.GeoServerResourceLoader

    static Python py;
    static PythonVectorFormatAdapter 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_vectorformat.py");
        FileUtils.copyURLToFile(PythonVectorFormatAdapterTest.class.getResource("foo_vectorformat.py"), f);
        adapter = new PythonVectorFormatAdapter(f, py);
View Full Code Here

Examples of org.geoserver.platform.GeoServerResourceLoader

    static Python py;
    static PythonProcessAdapter 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(PythonProcessAdapterTest.class.getResource("foo_process.py"), f);
        adapter = new PythonProcessAdapter(f, py);
View Full Code Here

Examples of org.geoserver.platform.GeoServerResourceLoader

        final GeoServer geoServer = getGeoServer();
        setupESRIFormatByDefault(geoServer, true);

        final FeatureSource fs = getFeatureSource(MockData.BASIC_POLYGONS);
        final Catalog catalog = getCatalog();
        final GeoServerResourceLoader resourceLoader = getResourceLoader();

        ShapeZipOutputFormat zip = new ShapeZipOutputFormat(geoServer, catalog, resourceLoader);
        ByteArrayOutputStream bos = new ByteArrayOutputStream();
        FeatureCollectionType fct = WfsFactory.eINSTANCE.createFeatureCollectionType();
        fct.getFeature().add(fs.getFeatures());
View Full Code Here

Examples of org.geoserver.platform.GeoServerResourceLoader

        if(Boolean.valueOf(relinquishLoggingControl)) {
            getLogger().info("RELINQUISH_LOG4J_CONTROL on, won't attempt to reconfigure LOG4J loggers");
        } else {
            try {
                File baseDir = new File(GeoserverDataDirectory.findGeoServerDataDir(context));
                GeoServerResourceLoader loader = new GeoServerResourceLoader(baseDir);
               
                File f= loader.find( "logging.xml" );
                if ( f != null ) {
                    XStreamPersister xp = new XStreamPersisterFactory().createXMLPersister();
                    BufferedInputStream in = new BufferedInputStream( new FileInputStream( f ) );
                    try {
                        LoggingInfo loginfo = xp.load(in,LoggingInfo.class);
                        final String location = getLogFileLocation(loginfo.getLocation());
                        LoggingUtils.initLogging(loader, loginfo.getLevel(), !loginfo.isStdOutLogging(),
                            location);
                    }
                    finally {
                        in.close();
                    }
                }
                else {
                    //check for old style data directory
                    f = loader.find( "services.xml" );
                    if ( f != null ) {
                        LegacyLoggingImporter loggingImporter = new LegacyLoggingImporter();
                        loggingImporter.imprt(baseDir);
                        final String location = getLogFileLocation(loggingImporter.getLogFile());
                        LoggingUtils.initLogging(loader, loggingImporter.getConfigFileName(), loggingImporter
View Full Code Here

Examples of org.geoserver.platform.GeoServerResourceLoader

        // exceptions)

        System.setProperty("org.geotools.referencing.forceXY", "true");
        File testdata = TestData.file(this, ".");
        System.setProperty("GEOSERVER_DATA_DIR", testdata.getAbsolutePath());
        GeoServerResourceLoader loader = new GeoServerResourceLoader(testdata);
        GenericWebApplicationContext context = new GenericWebApplicationContext();
        context.getBeanFactory().registerSingleton("resourceLoader", loader);
        GeoserverDataDirectory.init(context);

        // initialized WGS84 CRS (used by many tests)
View Full Code Here

Examples of org.geoserver.platform.GeoServerResourceLoader

   
    @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

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

Examples of org.geoserver.platform.GeoServerResourceLoader

    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
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.