...
Name | Default Value | Description |
---|---|---|
directory | true | indicates whether or not the given file name should be interpreted by default as a directory or file (as it sometimes hard to be sure with some FTP servers) |
password | null | specifies the password to use to login to the remote file system |
binary | false | specifies the file transfer mode BINARY or ASCII. Default is ASCII. |
consumer.setNames | false | Used by FTPConsumer. If set to true Camel will set the special filename header FileComponent.HEADER_FILE_NAME value to the filename from the FTP Server. |
consumer.delay | 500 | Delay in millis between each poll |
consumer.initialDelay | 1000 | Millis before polling starts |
consumer.userFixedDelay | false | true to use fixed delay between pools, otherwise fixed rate is used. See ScheduledExecutorService in JDK for details. |
consumer.exclusiveRead | true | New option in Camel 1.5: Used by FTPConsumer. If set to true Camel will only poll the ftp files if it has exclusive read to the file (= the file is not in progress of being written). Camel will wait until it is granted, testing once every second. The test is implemented by Camel will try to rename the file. Setting to false Camel will poll the file even if its in progress of being written (= this is the behavior of Camel 1.4). |
As this component is an extension to the File component the options from this parent component is also available.
...
When consuming files (downloading) you must use type conversation to either String or to InputStream for ASCII and BINARY file types.
In Camel 1.4 this is fixed, as there are build in type converters for the ASCII and BINARY file types, meaning that you do not need the convertBodyTo expression.
In Camel 1.4 or below Camel FTPConsumer will poll files regardless if the file is currently being written. See the consumer.exclusiveRead option.
Also in Camel 1.3 since setNames is default false then you must explicitly set the filename using the setHeader expression when consuming from FTP directly to File.
The code below illustrates this:
...