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.LineIteratorThis 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 Constructor Description FileLineIterator(File file)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()booleanhasNext()-
Methods inherited from class org.apache.commons.io.LineIterator
closeQuietly, isValidLine, next, nextLine, remove
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.Iterator
forEachRemaining
-
-
-
-
Constructor Detail
-
FileLineIterator
public FileLineIterator(File file) throws IOException
- Throws:
IOException
-
-
Method Detail
-
hasNext
public boolean hasNext()
-
close
public void close()
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classorg.apache.commons.io.LineIterator
-
-