public class SimpleFileSink extends AbstractModuleFixture<SimpleFileSink>
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DEFAULT_MODE |
label
Constructor and Description |
---|
SimpleFileSink()
Use XD Defaults for the file name and directory to where the sink will write its results.
|
SimpleFileSink(java.lang.String dir,
java.lang.String fileName,
boolean binary,
java.lang.String mode)
Construct a new SimpleFileSink given the directory and file to write to as well as the if the file is binary
and the mode that determines what to do if the file already exists.
|
Modifier and Type | Method and Description |
---|---|
SimpleFileSink |
binary(boolean binary)
Set the state of the binary flag for the SimpleFileSink instance.
|
SimpleFileSink |
dir(java.lang.String dir)
Establishes the directory the SimpleFileSink will write the file.
|
SimpleFileSink |
fileName(java.lang.String fileName)
Establishes the filename the SimpleFileSink will associate with the file.
|
SimpleFileSink |
mode(java.lang.String mode)
Establishes the mode in which the SimpleFileSink.
|
java.lang.String |
toDSL()
Renders the default DSL for this fixture.
|
static SimpleFileSink |
withDefaults(java.lang.String dir,
java.lang.String fileName)
Return an instance of a SimpleFileSink given the directory and file to write to.
|
label, toString
public static final java.lang.String DEFAULT_MODE
public SimpleFileSink()
public SimpleFileSink(java.lang.String dir, java.lang.String fileName, boolean binary, java.lang.String mode)
dir
- The name of the directory where the output file will be placed.fileName
- the name of the file.binary
- if true the not add a linefeed to the end of the line. if false a linefeed will be added to the end of the line.mode
- determines if the file should be REPLACE, APPEND, etcpublic static SimpleFileSink withDefaults(java.lang.String dir, java.lang.String fileName)
dir
- the directory where files should be writtenfileName
- the name of the file to be written.public java.lang.String toDSL()
toDSL
in class AbstractModuleFixture<SimpleFileSink>
public SimpleFileSink dir(java.lang.String dir)
dir
- the name of the directorypublic SimpleFileSink fileName(java.lang.String fileName)
fileName
- the name for the filepublic SimpleFileSink binary(boolean binary)
binary
- if true the not add a linefeed to the end of the line. if false a linefeed will be added to the end of the line.public SimpleFileSink mode(java.lang.String mode)
mode
- determines if the file existing file should be REPLACE, APPEND, etc