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:
java.io.Closeable
,java.lang.AutoCloseable
,java.util.Iterator<T>
- Enclosing class:
- FileIOUtils
@Deprecated(since="1.20.0", forRemoval=true) public static class FileIOUtils.BurnOnCloseFileIterator<T> extends AbstractIterator<T> implements java.io.Closeable
Deprecated, for removal: This API element is subject to removal in a future version.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(LineIterator iterator, Function<java.lang.String,T> transformer)
Deprecated, for removal: This API element is subject to removal in a future version.BurnOnCloseFileIterator(LineIterator iterator, java.io.File backingFile, Function<java.lang.String,T> transformer)
Deprecated, for removal: This API element is subject to removal in a future version.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
close()
Deprecated, for removal: This API element is subject to removal in a future version.static FileIOUtils.BurnOnCloseFileIterator<java.lang.String>
wrap(LineIterator iter)
Deprecated, for removal: This API element is subject to removal in a future version.static FileIOUtils.BurnOnCloseFileIterator<java.lang.String>
wrap(LineIterator iter, java.io.File backingFile)
Deprecated, for removal: This API element is subject to removal in a future version.-
Methods inherited from class com.google.common.collect.AbstractIterator
hasNext, next, peek
-
Methods inherited from class com.google.common.collect.UnmodifiableIterator
remove
-
-
-
-
Constructor Detail
-
BurnOnCloseFileIterator
public BurnOnCloseFileIterator(LineIterator iterator, Function<java.lang.String,T> transformer)
Deprecated, for removal: This API element is subject to removal in a future version.
-
BurnOnCloseFileIterator
public BurnOnCloseFileIterator(LineIterator iterator, java.io.File backingFile, Function<java.lang.String,T> transformer)
Deprecated, for removal: This API element is subject to removal in a future version.
-
-
Method Detail
-
close
public void close() throws java.io.IOException
Deprecated, for removal: This API element is subject to removal in a future version.- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
- Throws:
java.io.IOException
-
wrap
public static FileIOUtils.BurnOnCloseFileIterator<java.lang.String> wrap(LineIterator iter)
Deprecated, for removal: This API element is subject to removal in a future version.
-
wrap
public static FileIOUtils.BurnOnCloseFileIterator<java.lang.String> wrap(LineIterator iter, java.io.File backingFile)
Deprecated, for removal: This API element is subject to removal in a future version.
-
-