/** * Overrides to avoid the superclass' call to {@link #writer()} and it's {@code * UnsupportedOperationException} * * @return Iterator, should be closed closeIterator */ @Override protected Iterator<SimpleFeature> openIterator() throws IOException { try { return new FeatureReaderIterator<SimpleFeature>(reader()); } catch (IOException e) { return new NoContentIterator(e); } }
/** * Returns a FeatureWriterIterator, or FeatureReaderIterator over content. * * <p>If you have a way to tell that you are readonly please subclass with a less hardcore check * - this implementations catches a UnsupportedOpperationsException from wrtier()! * * @return Iterator, should be closed closeIterator */ protected Iterator<SimpleFeature> openIterator() throws IOException { try { FeatureWriter writer = writer(); if (writer != null) { return new FeatureWriterIterator(writer()); } } catch (IOException badWriter) { return new NoContentIterator(badWriter); } catch (UnsupportedOperationException readOnly) { } try { return new FeatureReaderIterator(reader()); } catch (IOException e) { return new NoContentIterator(e); } }
/** * Overrides to avoid the superclass' call to {@link #writer()} and it's * {@code UnsupportedOperationException} * * @return Iterator, should be closed closeIterator */ @Override protected Iterator<SimpleFeature> openIterator() throws IOException { try { return new FeatureReaderIterator<SimpleFeature>(reader()); } catch (IOException e) { return new NoContentIterator(e); } }
/** * Returns a FeatureWriterIterator, or FeatureReaderIterator over content. * <p> * If you have a way to tell that you are readonly please subclass with * a less hardcore check - this implementations catches a * UnsupportedOpperationsException from wrtier()! * * @return Iterator, should be closed closeIterator */ protected Iterator openIterator() throws IOException { try { return new FeatureWriterIterator( writer() ); } catch (IOException badWriter) { return new NoContentIterator( badWriter ); } catch( UnsupportedOperationException readOnly ){ } try { return new FeatureReaderIterator( reader() ); } catch (IOException e) { return new NoContentIterator( e ); } }
/** * Returns a FeatureWriterIterator, or FeatureReaderIterator over content. * <p> * If you have a way to tell that you are readonly please subclass with * a less hardcore check - this implementations catches a * UnsupportedOpperationsException from wrtier()! * * @return Iterator, should be closed closeIterator */ protected Iterator<SimpleFeature> openIterator() throws IOException { try { FeatureWriter writer = writer(); if(writer != null) { return new FeatureWriterIterator( writer() ); } } catch (IOException badWriter) { return new NoContentIterator( badWriter ); } catch( UnsupportedOperationException readOnly ){ } try { return new FeatureReaderIterator( reader() ); } catch (IOException e) { return new NoContentIterator( e ); } }