Class FileIOUtils.BurnOnCloseFileIterator<T>
- java.lang.Object
-
- com.google.common.collect.UnmodifiableIterator<T>
-
- com.google.common.collect.AbstractIterator<T>
-
- org.apache.jackrabbit.oak.commons.FileIOUtils.BurnOnCloseFileIterator<T>
-
- Type Parameters:
T
- the type of elements in the iterator
- All Implemented Interfaces:
Closeable
,AutoCloseable
,Iterator<T>
- Enclosing class:
- FileIOUtils
@Deprecated public static class FileIOUtils.BurnOnCloseFileIterator<T> extends AbstractIterator<T> implements Closeable
Deprecated.useBurnOnCloseFileIterator
insteadImplements aCloseable
wrapper over aLineIterator
. Also has a transformer to transform the output. If the underlying file is provide then it deletes the file onclose()
. If there is a scope for lines in the file containing line break characters it should be ensured that the files is written withFileIOUtils.writeAsLine(BufferedWriter, String, boolean)
with true to escape line break characters and should be properly unescaped on read. A custom transformer can also be provided to unescape.
-
-
Constructor Summary
Constructors Constructor Description BurnOnCloseFileIterator(org.apache.commons.io.LineIterator iterator, Function<String,T> transformer)
Deprecated.BurnOnCloseFileIterator(org.apache.commons.io.LineIterator iterator, File backingFile, Function<String,T> transformer)
Deprecated.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
close()
Deprecated.protected T
computeNext()
Deprecated.static FileIOUtils.BurnOnCloseFileIterator<String>
wrap(org.apache.commons.io.LineIterator iter)
Deprecated.static FileIOUtils.BurnOnCloseFileIterator<String>
wrap(org.apache.commons.io.LineIterator iter, File backingFile)
Deprecated.-
Methods inherited from class com.google.common.collect.AbstractIterator
endOfData, hasNext, next, peek
-
Methods inherited from class com.google.common.collect.UnmodifiableIterator
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
-
-
-
-
Method Detail
-
computeNext
protected T computeNext()
Deprecated.- Specified by:
computeNext
in classAbstractIterator<T>
-
close
public void close() throws IOException
Deprecated.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
-
wrap
public static FileIOUtils.BurnOnCloseFileIterator<String> wrap(org.apache.commons.io.LineIterator iter)
Deprecated.
-
wrap
public static FileIOUtils.BurnOnCloseFileIterator<String> wrap(org.apache.commons.io.LineIterator iter, File backingFile)
Deprecated.
-
-