Skip to main content
Version: 4.12.1

File component

file_component

The File Component interacts with the file system both as an inbound and outbound component.

Configuration

The File component has the following basic configuration options:

Force inbound

Description

Settings this to Yes will force the component to turn from outbound to inbound and consume a file from the (S)FTP(S) server. This has the same behavior as putting the component below an Enrich component that is set to Override. This means that the current body will be overridden with the new body of the consumed file.

Remarks

  • Only available when the component is outbound.
  • Only one file will be consumed when the component is forced to be inbound.
  • This options only becomes visible when another component is connected on the left side of this component.

Path

Description

Path to the target directory. In case of inbound this is the directory where Dovetail will be picking up files from, if used as outbound this is the directory where Dovetail will write files to.

Remarks

  • If you include a / at the end of the path, the component will try to copy the whole file path and not the file!

File Name

Description

Get specific file with this name when inbound or set file name when outbound.

Charset

Description

Specifies the encoding of the file.

Remarks

Auto Create

Options

  • Yes (default)
  • No

Description

Automatically creates missing directories in the file path.

Remarks

  • Only available when the component is outbound.

Recursive

Options

  • Yes
  • No (default)

Description

When inbound, specifies whether Dovetail should process files only in the specified path (No) or in all subdirectories of the path too (Yes).

Remark

When set to Yes you must make sure that your exclude pattern will ignore the directory were you place the processed files, otherwise you will end up with a infinite loop.

Delete file

Options

  • Yes
  • No (default)

Description

If set to Yes, the file will be deleted after it is processed.

Remarks

  • Only available when the component is inbound.
  • If the DeleteFile property is set to No, processed files will be moved to a directory with the name: .camel

File Exist

Options

  • Override (default)
  • Append
  • Ignore
  • Fail

Description

Specify what to do if a file with the same name already exists.

Remarks

  • Only available when the component is outbound.

Include

Description

Used to include files, if the filename matches the regular expressions pattern.

Remarks

  • Only available when the component is inbound.

Exclude

Description

Used to exclude files, if the filename matches the regular expressions pattern.

Remarks

  • Only available when the component is inbound.

Initial delay

Description

Milliseconds to wait before polling the file/directory starts.

Remarks

  • Only available when the component is inbound.

Delay

Description

Milliseconds to wait before the next poll of the file/directory.

Remarks

  • Only available when the component is inbound.

Producing large text files (> 10 MB)

When producing large text files like XML or JSON you might want to leave the charset option empty. This tells Dovetail that it should read the file as binary which means it does not have to read all the file's content into memory to validate the charset. This is better for it's performance and can prevent errors parsing the file later on in the flow.