Class DefaultFileNameGenerator

java.lang.Object
org.springframework.integration.util.AbstractExpressionEvaluator
org.springframework.integration.file.DefaultFileNameGenerator
All Implemented Interfaces:
Aware, BeanFactoryAware, InitializingBean, FileNameGenerator

public class DefaultFileNameGenerator
extends AbstractExpressionEvaluator
implements FileNameGenerator
Default implementation of the filename generator strategy. It evaluates an expression against the Message in order to generate the file name. Either the 'expression' property can be set directly, or for a simple header name to be used as the filename, there is also a setHeaderName(String) method for convenience. If neither a header name nor custom expression is set, the default header name is defined by the constant FileHeaders.FILENAME. If no String-typed value is returned from the expression evaluation (or associated with the header if no expression has been provided), it checks if the Message payload is a File instance, and if so, it uses the same name. Finally, it falls back to the Message ID and adds the suffix '.msg'.
Author:
Mark Fisher, Gary Russell, Artem Bilan