Package org.pipecraft.pipes.terminal
Class TxtFileWriterPipe
- java.lang.Object
-
- org.pipecraft.pipes.terminal.TerminalPipe
-
- org.pipecraft.pipes.terminal.TxtFileWriterPipe
-
- All Implemented Interfaces:
Closeable,AutoCloseable,BasePipe
public class TxtFileWriterPipe extends TerminalPipe
A terminal pipe writing text lines from the input pipe into a file. Supports compression.- Author:
- Eyal Schneider
- See Also:
TxtFileReaderPipe
-
-
Constructor Summary
Constructors Constructor Description TxtFileWriterPipe(Pipe<String> input, File f)Constructor Uses default file write options and UTF8 charset encoding.TxtFileWriterPipe(Pipe<String> input, File f, Charset charset)Constructor Uses default file write options.TxtFileWriterPipe(Pipe<String> input, File f, Charset charset, FileWriteOptions options)ConstructorTxtFileWriterPipe(Pipe<String> input, File f, FileWriteOptions options)Constructor Uses UTF8 charset encoding.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()voidstart()Performs pre-processing prior to item flow throw the pipe.-
Methods inherited from class org.pipecraft.pipes.terminal.TerminalPipe
getProgress
-
-
-
-
Constructor Detail
-
TxtFileWriterPipe
public TxtFileWriterPipe(Pipe<String> input, File f, Charset charset, FileWriteOptions options)
Constructor- Parameters:
input- The input pipef- The text file to write to, one item per linecharset- The charset to useoptions- The file writing options
-
TxtFileWriterPipe
public TxtFileWriterPipe(Pipe<String> input, File f, Charset charset)
Constructor Uses default file write options.- Parameters:
input- The input pipef- The text file to write to. If exists, the file is being overwritten.charset- The charset to use
-
TxtFileWriterPipe
public TxtFileWriterPipe(Pipe<String> input, File f)
Constructor Uses default file write options and UTF8 charset encoding.- Parameters:
input- The input pipef- The text file to write to. If exists, the file is being overwritten.
-
TxtFileWriterPipe
public TxtFileWriterPipe(Pipe<String> input, File f, FileWriteOptions options)
Constructor Uses UTF8 charset encoding.- Parameters:
input- The input pipef- The text file to write to. If exists, the file is being overwritten.options- The file writing options
-
-
Method Detail
-
close
public void close() throws IOException- Throws:
IOException
-
start
public void start() throws PipeException, InterruptedExceptionDescription copied from interface:BasePipePerforms pre-processing prior to item flow throw the pipe. Implementations must call the same method for all their input pipes before accessing their items. This is typically done here.- Throws:
PipeException- In case of pipe errors in this pipe or somewhere up-stream.InterruptedException- In case that the operation has been interrupted by another thread.
-
-