org.springframework.integration.file
Class FileWritingMessageHandler
java.lang.Object
org.springframework.integration.file.FileWritingMessageHandler
- All Implemented Interfaces:
- MessageHandler
public class FileWritingMessageHandler
- extends java.lang.Object
- implements MessageHandler
A MessageHandler
implementation that writes the Message payload to a
file. If the payload is a File object, it will copy the File to this
consumer's directory. If the payload is a byte array or String, it will
write it directly. Otherwise, it will invoke toString on the payload Object.
- Author:
- Mark Fisher
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
FileWritingMessageHandler
public FileWritingMessageHandler(java.lang.String parentDirectoryPath)
FileWritingMessageHandler
public FileWritingMessageHandler(java.io.File parentDirectory)
setFileNameGenerator
public void setFileNameGenerator(FileNameGenerator fileNameGenerator)
setCharset
public void setCharset(java.lang.String charset)
- Set the charset name to use when writing a File from a
String-based Message payload.
handleMessage
public void handleMessage(Message<?> message)
- Specified by:
handleMessage
in interface MessageHandler