T - object type@In(value=java.lang.Object.class) @FluxCommand(value="write-files") public final class ObjectFileWriter<T> extends AbstractObjectWriter<T>
DEFAULT_FOOTER, DEFAULT_HEADER, DEFAULT_SEPARATOR| Constructor and Description |
|---|
ObjectFileWriter(java.lang.String path)
Sets the destination of a file to write objects to.
|
| Modifier and Type | Method and Description |
|---|---|
void |
closeStream() |
FileCompression |
getCompression()
Returns the compression mode.
|
java.lang.String |
getEncoding()
Returns the encoding used by the underlying writer.
|
void |
process(T obj) |
void |
resetStream() |
void |
setAppendIfFileExists(boolean appendIfFileExists)
Controls whether to open files in append mode if they exist.
|
void |
setCompression(FileCompression compression)
Sets the compression mode.
|
void |
setCompression(java.lang.String compression)
Sets the compression mode.
|
void |
setEncoding(java.lang.String encoding)
Sets the encoding used by the underlying writer.
|
getFooter, getHeader, getSeparator, setFooter, setHeader, setSeparatorpublic ObjectFileWriter(java.lang.String path)
path - the path to be written topublic java.lang.String getEncoding()
ConfigurableObjectWriterpublic void setEncoding(java.lang.String encoding)
ConfigurableObjectWriterencoding - name of the encodingpublic FileCompression getCompression()
ConfigurableObjectWriterpublic void setCompression(FileCompression compression)
ConfigurableObjectWritercompression - type of compressionpublic void setCompression(java.lang.String compression)
ConfigurableObjectWritercompression - type of compressionpublic void process(T obj)
public void resetStream()
public void closeStream()
public void setAppendIfFileExists(boolean appendIfFileExists)
The default value is false.
This property can be changed anytime during processing. It becomes effective the next time a new output file is opened.
appendIfFileExists - true if new data should be appended,
false to overwrite the existing file