我正在使用camel-ftp,我在目录名中遇到连接到FTP-Server的德语变音符号(例如Ö)。我无法重命名此目录,因为它是公司的工作目录。
我使用camel.version:2.18.1和camel-ftp.version:2.18.1。
我配置了以下路线(在路线中我定义了包含umlaut的目录,其中包含用于Ö的unicode字符\ u00d6):
from(ftp://user@hostname:21/etc/\u00d6ffentlicherOrdner/test?password=pwd).routeId("kurse").to(...)
错误讯息:
Consumer FtpConsumer[ftp://user@hostname:21/etc//0�ffentlicherOrdner/test?password=xxxxxx]
failed polling endpoint: ftp://ftp://user@hostname:21/etc/0�ffentlicherOrdner/test?password=xxxxxx.
Will try again at next poll.
Caused by: [org.apache.camel.component.file.GenericFileOperationFailedException -
File operation failed: 550 �ffentlicherOrdner: Das System kann die angegebene Datei nicht finden.
当我使用以下参数扩展路线时:
&ftpClient.controlEncoding=ISO-8859-15
&charset=ISO-8859-15
&consumer.bridgeErrorHandler=true
然后我得到一切看起来很好的输出,因为我没有收到任何错误消息:
Route: kurse started and consuming from: ftp://user@hostname:21/etc/ÖffentlicherOrdner/test?charset=ISO-8859-1&consumer.bridgeErrorHandler=true&ftpClient.controlEncoding=ISO-8859-1&password=xxxxxx
但是现在没有文件被轮询。我在测试目录中有一些文件,但是当我启动该过程时,它不会将文件推送到端点。
我不明白为什么它没有消耗文件?也许编码仍然是错误的?
修改
关于我错过检查FTP属性的编码我是如此固定。
我的问题的解决方案是设置passiveMode:
&passiveMode=true