public SimpleFeatureSource getFeatureSource(String typeName) throws IOException { SimpleFeatureSource fs = getDataStore(typeName).getFeatureSource(typeName); if (fs instanceof SimpleFeatureLocking) { return new DirectoryFeatureLocking((SimpleFeatureLocking) fs); } else if (fs instanceof FeatureStore) { return new DirectoryFeatureStore((SimpleFeatureStore) fs); } else { return new DirectoryFeatureSource((SimpleFeatureSource) fs); } }
FeatureSource featureSource = currLayer.getFeatureSource(); if(featureSource instanceof DirectoryFeatureSource) { featureSource = ((DirectoryFeatureSource) featureSource).unwrap();
public SimpleFeatureSource getFeatureSource( String typeName) throws IOException { SimpleFeatureSource fs = getDataStore(typeName).getFeatureSource(typeName); if(fs instanceof SimpleFeatureLocking) { return new DirectoryFeatureLocking((SimpleFeatureLocking) fs); } else if(fs instanceof FeatureStore) { return new DirectoryFeatureStore((SimpleFeatureStore) fs); } else { return new DirectoryFeatureSource((SimpleFeatureSource) fs); } }
public FeatureSource<SimpleFeatureType, SimpleFeature> getFeatureSource( String typeName) throws IOException { FeatureSource<SimpleFeatureType, SimpleFeature> fs = getDataStore(typeName).getFeatureSource(typeName); if(fs instanceof FeatureLocking) { return new DirectoryFeatureLocking((FeatureLocking<SimpleFeatureType, SimpleFeature>) fs, this); } else if(fs instanceof FeatureStore) { return new DirectoryFeatureStore((FeatureStore<SimpleFeatureType, SimpleFeature>) fs, this); } else { return new DirectoryFeatureSource((FeatureSource<SimpleFeatureType, SimpleFeature>) fs, this); } }