3.3 File Adapters

The FileSourceAdapter extends the generic PollingSourceAdapter (just as the polling JMS adapter does). It requires the following constructor arguments:

public FileSourceAdapter(File directory, MessageChannel channel, int period)

Optional properties include 'initialDelay' and 'maxMessagesPerTask'.

The FileTargetAdapter constructor only requires the 'directory' argument. The target adapter also accepts an implementation of the FileNameGenerator strategy that defines the following method:

String generateFileName(Message message)

As with the JMS adapters, the most convenient way to configure File adapters is with the namespace support. For examples, see the section called “Configuring Channel Adapters”.