Example usage for org.springframework.integration.file FileWritingMessageHandler setAppendNewLine

List of usage examples for org.springframework.integration.file FileWritingMessageHandler setAppendNewLine

Introduction

In this page you can find the example usage for org.springframework.integration.file FileWritingMessageHandler setAppendNewLine.

Prototype

public void setAppendNewLine(boolean appendNewLine) 

Source Link

Document

If 'true' will append a new-line after each write.

Usage

From source file:org.vferrer.scdfstokker.config.FileSinkConfiguration.java

/**
 * Had to copy this class in order to be able to put an object to string
 * converter before writing it to the file 
 *//*from   w  w w.  j  a  v  a  2s.c  om*/
@Bean
@ServiceActivator(inputChannel = "stringChannel")
public FileWritingMessageHandler fileWritingMessageHandler(FileNameGenerator fileNameGenerator,
        FileSinkProperties properties) {
    FileWritingMessageHandler handler = (properties.getDirectoryExpression() != null)
            ? new FileWritingMessageHandler(properties.getDirectoryExpression())
            : new FileWritingMessageHandler(new File(properties.getDirectory()));
    handler.setAutoCreateDirectory(true);
    handler.setAppendNewLine(!properties.isBinary());
    handler.setCharset(properties.getCharset());
    handler.setExpectReply(false);
    handler.setFileExistsMode(properties.getMode());
    handler.setFileNameGenerator(fileNameGenerator);
    return handler;
}