public class FormattedFilenameCreator extends java.lang.Object implements FileNameCreator
String.format(String, Object...)
.
This is intended as a replacement for StandardFilenameCreator which is now deprecated. It makes use of the JDK1.5
String.format(String, Object...)
method which will allow you to generate an arbitary filename rather than being
restricted to a prefix + suffix + timestamp.
The following rules will apply when you are constructing your formatted filename
Formatter
Date
) is passed in as the second parameterIf the message in question has a unique-id of b740ddae-ff4d-4576-9bc9-51d0f14b6df4 and the current date and time is "2012-05-02 09:41:23" then we would use to following formats to generate output that matches our criteria.
String.format(String, Object...)
,
Formatter
In the adapter configuration file this class is aliased as formatted-filename-creator which is the preferred alternative to the fully qualified classname when building your configuration.
Constructor and Description |
---|
FormattedFilenameCreator() |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
createName(AdaptrisMessage msg)
Returns a file name for the passed
AdaptrisMessage . |
java.lang.String |
getFilenameFormat() |
void |
setFilenameFormat(java.lang.String s) |
public java.lang.String createName(AdaptrisMessage msg)
FileNameCreator
Returns a file name for the passed AdaptrisMessage
.
createName
in interface FileNameCreator
msg
- the AdaptrisMessage
to create a file name forpublic java.lang.String getFilenameFormat()
public void setFilenameFormat(java.lang.String s)