@Test public void testIndexOutOfDate() throws Exception { File shpFile = copyShapefiles(STATE_POP); ShpFileType fix = ShpFileType.FIX; File fixFile = sibling(shpFile, fix.extension); fixFile.delete(); ShapefileDataStore ds = new ShapefileDataStore(shpFile.toURI().toURL()); ds.indexManager.createFidIndex(); assertFalse(ds.indexManager.isIndexStale(fix)); long fixMod = fixFile.lastModified(); shpFile.setLastModified(fixMod + 1000000); assertTrue(ds.indexManager.isIndexStale(fix)); assertTrue(fixFile.setLastModified(shpFile.lastModified())); assertFalse(ds.indexManager.isIndexStale(fix)); assertTrue(fixFile.delete()); assertTrue(ds.indexManager.isIndexStale(fix)); ds.dispose(); }
@Override public void dispose() { super.dispose(); if (shpFiles != null) { shpFiles.dispose(); shpFiles = null; } }
ShapefileDataStore extends ContentDataStore implements FileDataStore { @Override public void dispose() { super.dispose(); if (shpFiles != null) { shpFiles.dispose(); shpFiles = null; } } }
ShapefileDataStore extends ContentDataStore implements FileDataStore { @Override public void dispose() { super.dispose(); if (shpFiles != null) { shpFiles.dispose(); shpFiles = null; } } ShapefileDataStore(URL url); }
ShapefileDataStore extends ContentDataStore implements FileDataStore { @Override public void dispose() { super.dispose(); if (shpFiles != null) { shpFiles.dispose(); shpFiles = null; } } ShapefileDataStore(URL url); ContentFeatureSource getFeatureSource(); Charset getCharset(); void setCharset(Charset charset); TimeZone getTimeZone(); void setTimeZone(TimeZone timeZone); boolean isMemoryMapped(); void setMemoryMapped(boolean memoryMapped); boolean isBufferCachingEnabled(); void setBufferCachingEnabled(boolean bufferCachingEnabled); boolean isIndexed(); void setIndexed(boolean indexed); SimpleFeatureType getSchema(); FeatureReader<SimpleFeatureType, SimpleFeature> getFeatureReader(); long getCount(Query query); void createSchema(SimpleFeatureType featureType); void forceSchemaCRS(CoordinateReferenceSystem crs); @Override void dispose(); boolean isFidIndexed(); void setFidIndexed(boolean fidIndexed); @Override String toString(); @Override void updateSchema(SimpleFeatureType featureType); @Override FeatureWriter<SimpleFeatureType, SimpleFeature> getFeatureWriter(
            Filter filter, Transaction transaction); @Override FeatureWriter<SimpleFeatureType, SimpleFeature> getFeatureWriter(Transaction transaction); @Override FeatureWriter<SimpleFeatureType, SimpleFeature> getFeatureWriterAppend(
            Transaction transaction); boolean isIndexCreationEnabled(); void setIndexCreationEnabled(boolean indexCreationEnabled); @Override void removeSchema(String typeName); @Override void removeSchema(Name typeName); }
ShapefileDataStore extends ContentDataStore implements FileDataStore { @Override public void dispose() { super.dispose(); if (shpFiles != null) { shpFiles.dispose(); shpFiles = null; } } ShapefileDataStore(URL url); ContentFeatureSource getFeatureSource(); Charset getCharset(); void setCharset(Charset charset); TimeZone getTimeZone(); void setTimeZone(TimeZone timeZone); boolean isMemoryMapped(); void setMemoryMapped(boolean memoryMapped); boolean isBufferCachingEnabled(); void setBufferCachingEnabled(boolean bufferCachingEnabled); boolean isIndexed(); void setIndexed(boolean indexed); SimpleFeatureType getSchema(); FeatureReader<SimpleFeatureType, SimpleFeature> getFeatureReader(); long getCount(Query query); void createSchema(SimpleFeatureType featureType); void forceSchemaCRS(CoordinateReferenceSystem crs); @Override void dispose(); boolean isFidIndexed(); void setFidIndexed(boolean fidIndexed); @Override String toString(); @Override void updateSchema(SimpleFeatureType featureType); @Override FeatureWriter<SimpleFeatureType, SimpleFeature> getFeatureWriter(
            Filter filter, Transaction transaction); @Override FeatureWriter<SimpleFeatureType, SimpleFeature> getFeatureWriter(Transaction transaction); @Override FeatureWriter<SimpleFeatureType, SimpleFeature> getFeatureWriterAppend(
            Transaction transaction); boolean isIndexCreationEnabled(); void setIndexCreationEnabled(boolean indexCreationEnabled); @Override void removeSchema(String typeName); @Override void removeSchema(Name typeName); static final String ORIGINAL_FIELD_NAME; static final String ORIGINAL_FIELD_DUPLICITY_COUNT; static final Charset DEFAULT_STRING_CHARSET; static final TimeZone DEFAULT_TIMEZONE; }