Package org.geotools.data

Examples of org.geotools.data.DataStore.dispose()


       
        DataStore dds = new DirectoryDataStore(tempDir, getFileStoreFactory());
      
        assertEquals(1, dds.getTypeNames().length);
        assertEquals("archsites", dds.getTypeNames()[0]);
        dds.dispose();
    }
   
    @Test
    @Ignore
    // this test is skipped, it checks something that formally is what we should expect,
View Full Code Here


       
        DataStore dds = new DirectoryDataStore(tempDir, getFileStoreFactory());
        FeatureSource fs = dds.getFeatureSource("archsites");
        assertNotNull(fs);
        assertSame(dds, fs.getDataStore());
        dds.dispose();
    }

    @Test
    public void testCreateSchema() throws Exception {
        File dir = File.createTempFile("foo", "shp", new File("target"));
View Full Code Here

       
        SimpleFeatureType ft = ds.getSchema("foo");
        assertNotNull(ft);
       
        //clean up
        ds.dispose();
        for (File f : dir.listFiles()) {
            f.delete();
        }
        dir.delete();
    }
View Full Code Here

          return true;
       
            }finally{
            try {
              if(tileIndexStore!=null)
                tileIndexStore.dispose();
            } catch (Throwable e) {
              if (LOGGER.isLoggable(Level.FINE))
                LOGGER.log(Level.FINE, e.getLocalizedMessage(), e);
            }             
            }
View Full Code Here

        params.put("url", TestData.url(TEST_FILE));
        DataStore ds = DataStoreFinder.getDataStore(params);
        assertNotNull(ds);
        params.put("url", TestData.url(TEST_FILE).toString());
        assertNotNull(ds);
        ds.dispose();
    }

    @Test
    public void testBadURL() {
        HashMap params = new HashMap();
View Full Code Here

        s.createSchema(type);
        String typeName = type.getTypeName();
        SimpleFeatureStore store = (SimpleFeatureStore) s.getFeatureSource(s.getTypeNames()[0]);

        store.addFeatures(features);
        s.dispose();
       

        s = new ShapefileDataStore(tmpFile.toURI().toURL());
        typeName = s.getTypeNames()[0];
        SimpleFeatureSource source = s.getFeatureSource(typeName);
View Full Code Here

        typeName = s.getTypeNames()[0];
        SimpleFeatureSource source = s.getFeatureSource(typeName);
        SimpleFeatureCollection fc = source.getFeatures();

        ShapefileReadWriteTest.compare(features, fc);
        s.dispose();
    }

    @Test
    public void testSkippingRecords() throws Exception {
        final URL url = TestData.url(STATEPOP);
View Full Code Here

   
    @Override
    public void clear() {
        DataStore store = get();
        if(store != null)
            store.dispose();
        super.clear();
    }

}
View Full Code Here

        }
       
        void dispose() {
            DataStore store = ref != null ? ref.get() : null;
            if(store != null)
                store.dispose();
            ref.clear();
        }
    }
   
   
View Full Code Here

        System.out.println("t2 commit          t2: "
                + DataUtilities.fidSet(featureStore2.getFeatures()));

        t1.close();
        t2.close();
        store.dispose(); // clear out any listeners
        // transactionExample end
        System.out.println("\ntransactionExample end\n");

        fileContents("transactionExample",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.