@ Override public Iterator < Reader > iterator ( ) { Collection < Object > newCollection = new ArrayList < Object > ( ) ; for ( Object o : c ) { if ( o instanceof Reader ) { String name = o . toString ( ) + ".tmp" ; File tmpFile ; try { tmpFile = File . createTempFile ( name , "" ) ; } catch ( Exception e ) { throw new RuntimeException ( e . getMessage ( ) ) ; } tmpFile . deleteOnExit ( ) ; StringUtils . printToFile ( tmpFile , IOUtils . slurpReader ( ( Reader ) o ) , false , false , enc ) ; newCollection . add ( tmpFile ) ; } else { newCollection . add ( o ) ; } } c = newCollection ; return new ReaderIterator ( ) ; }
Returns an Iterator over the input sources in the underlying Collection .