org.springframework.integration.file
Class DefaultFileNameGenerator
java.lang.Object
org.springframework.integration.file.DefaultFileNameGenerator
- All Implemented Interfaces:
- FileNameGenerator
public class DefaultFileNameGenerator
- extends Object
- implements FileNameGenerator
Default implementation of the filename generator strategy. It first checks
for a message header whose name matches its 'headerName' property. The
default header name is defined by the constant FileHeaders.FILENAME
.
A custom header name can be provided via setHeaderName(String)
. If
no String-typed value is associated with that header 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
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DefaultFileNameGenerator
public DefaultFileNameGenerator()
setHeaderName
public void setHeaderName(String headerName)
- Specify a custom header name to check for the file name.
The default is defined by
FileHeaders.FILENAME
.
generateFileName
public String generateFileName(Message<?> message)
- Specified by:
generateFileName
in interface FileNameGenerator
Copyright © 2010. All Rights Reserved.