public void close() throws IOException { delegate.close(); delegate = null; builder = null; }
/** Close the reader please. */ public void close() { if (reader != null) { try { reader.close(); } catch (Exception e) { // sorry but iterators die quitely in the night } reader = null; } } }
@Override public void close() throws IOException { if (wrapped != null) { wrapped.close(); } wrapped = null; }
/** @see org.geotools.data.FeatureReader#close() */ public void close() throws IOException { if (reader != null) { reader.close(); reader = null; featureType = null; types = null; } } }
/** @see org.geotools.data.FeatureReader#close() */ public void close() throws IOException { if (reader != null) { reader.close(); reader = null; } if (diff != null) { diff = null; addedIterator = null; } }
@Override public void close() throws IOException { r.close(); }
public void close() throws IOException { reader.close(); } }
public void close() throws IOException { delegate.close(); } }
public void close() throws IOException { backendReader.close(); }
public void close() throws IOException { featureReader.close(); }
public void close() { try { delegate.close(); } catch (IOException e) { throw new RuntimeException(e); } } }
/** @see org.geotools.data.FeatureReader#close() */ public void close() throws IOException { if (reader == null) { throw new IllegalStateException("Reader has already been closed"); } reader.close(); reader = null; builder = null; } }
@Test public void testGetFeaturesReader() throws Exception { FeatureReader<SimpleFeatureType, SimpleFeature> fr; fr = rts.getFeatureReader(new Query(RENAMED), Transaction.AUTO_COMMIT); SimpleFeature sf = fr.next(); fr.close(); assertEquals(primitive, sf.getFeatureType()); // check the feature ids have been renamed as well assertTrue( "Feature id has not been renamed, it's still " + sf.getID(), sf.getID().startsWith(RENAMED)); }
@Test public void testGetFeaturesReader() throws Exception { FeatureReader<SimpleFeatureType, SimpleFeature> fr; fr = rts.getFeatureReader(new Query(RENAMED), Transaction.AUTO_COMMIT); SimpleFeature sf = fr.next(); fr.close(); assertEquals(RENAMED, sf.getFeatureType().getName().getLocalPart()); // check the feature ids have been renamed as well assertTrue( "Feature id has not been renamed, it's still " + sf.getID(), sf.getID().startsWith(RENAMED)); }
/** @see FeatureWriter#hasNext() */ public final boolean hasNext() throws IOException { // filteredContent may be null because we // took the precaution of closing it in a previous call // to this method final boolean hasNext = filteredContent != null && filteredContent.hasNext(); // be cautious of badly coded clients if (!hasNext && filteredContent != null) { filteredContent.close(); filteredContent = null; } return hasNext; }
@Test public void testFeatureReaderFidFilter() throws Exception { FeatureReader<SimpleFeatureType, SimpleFeature> fr; fr = rts.getFeatureReader(new Query(RENAMED, fidFilter), Transaction.AUTO_COMMIT); assertEquals(primitive, fr.getFeatureType()); assertTrue(fr.hasNext()); SimpleFeature sf = fr.next(); assertFalse(fr.hasNext()); fr.close(); assertEquals(fid, sf.getID()); }
public void close() { try { reader.close(); } catch (IOException e) { throw new AssertionError(e); } } };
@Test public void testFeautureReaderFidFilter() throws Exception { FeatureReader<SimpleFeatureType, SimpleFeature> fr; fr = rts.getFeatureReader(new Query(RENAMED, fidFilter), Transaction.AUTO_COMMIT); assertEquals(RENAMED, fr.getFeatureType().getName().getLocalPart()); assertTrue(fr.hasNext()); SimpleFeature sf = fr.next(); assertFalse(fr.hasNext()); fr.close(); assertEquals(fid, sf.getID()); }
/** @see FeatureWriter#close() */ public void close() throws IOException { if (filteredContent != null) { filteredContent.close(); filteredContent = null; } // let repeatedly calling close() be inoffensive if (session != null && !session.isDisposed()) { session.dispose(); } session = null; }