File Component

The File component provides access to file systems; allowing files to be processed by any other Camel Components or messages from other components can be saved to disk.

URI format

file:fileName

Where fileName represents the underlying file name

URI Options

Name Default Value Description
initialDelay 1000 milliseconds before polling the file/directory starts
delay 500 milliseconds before the next poll of the file/directory
useFixedDelay false if true, poll once after the initial delay
recursive true if a directory, will look for changes in files in all the sub directories
lock true if true will lock the file for the duration of the processing
regexPattern null will only fire a an exchange for a file that matches the regex pattern
delete false If delete is true then the file will be deleted when it is processed (the default is to move it, see below)
noop false If true then the file is not moved or deleted in any way (see below). This option is good for read only data, or for ETL type requirements
moveNamePrefix null The prefix String prepended to the filename when moving it. For example to move processed files into the done directory, set this value to 'done/'
moveNamePostfix null The postfix String apended to the filename when moving it. For example to rename processed files from foo to foo.old set this value to '.old'

By default the file is locked for the duration of the processing. Also when files are processed they are moved into the .camel directory; so that they appear to be deleted.

Message Headers

The following message headers can be used to affect the behaviour of the component

Header Description
org.apache.camel.file.name Specifies the output file name (relative to the endpoint directory) to be used for the output message when sending to the endpoint. If this is not present then a generated message ID is used instead

See Also

Graphic Design By Hiram