Package org.duracloud.mill.util
Class FileLineIterator
java.lang.Object
org.apache.commons.io.LineIterator
org.duracloud.mill.util.FileLineIterator
- All Implemented Interfaces:
Closeable,AutoCloseable,Iterator<String>
public class FileLineIterator
extends org.apache.commons.io.LineIterator
This Iterator's items are lines of a file. The hasNext() method returns true
if the file contains anymore lines, false otherwise. The next() method
returns the next line in the file.
Once all lines have been iterated through and hasNext() returns false the
underlying file is deleted.
- Author:
- Erik Paulsson Date: 5/2/14
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class org.apache.commons.io.LineIterator
closeQuietly, isValidLine, next, nextLine, removeMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Iterator
forEachRemaining
-
Constructor Details
-
FileLineIterator
- Throws:
IOException
-
-
Method Details
-
hasNext
public boolean hasNext() -
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classorg.apache.commons.io.LineIterator
-