apache-nifi - Nifi ftp 失败,路径不存在

标签 apache-nifi

使用 nifi ListFTP 和 GetFTP 处理器,我可以按预期访问远程 ftp 目录和文件,但此路径除外:

/Oa 45° 25t 32rn

我收到不存在的路径错误。其他带有空格的路径工作正常。 (其他客户端“filezilla”可以在这条路径上正常工作。)但是,Nifi 却不能。如果是度数 char °,我该如何转义它?我试过:

  1. “/Oa 45°25t 32rn”
  2. '/Oa 45° 25t 32rn'
  3. '"'/Oa 45° 25t 32rn'"'
  4. /Oa\45°\25t\32rn
  5. Oa%2045%C2%B0%2025t%2032rn(网址编码,全部尝试)

有什么想法为什么会失败以及如何解决吗?谢谢。

最佳答案

我没有包含非 ASCII 字符目录的 FTP 服务器,因此我无法明确测试这一点,但我建议使用 UTF-8 Unicode encoding 0xC2B0\uC2B0 看看是否有效。

来自FileZilla Character Encoding :

The FTP protocol is specified in RFC 959, which was published in 1985. The FTP protocol is designed on top of the original Telnet protocol, which is specified in RFC 854. The relevant sections of the Telnet specification regarding FTP are those covering the Network Virtual Terminal (NVT). According to RFC 854, the NVT requires the use of (7-bit) ASCII as the character set. Use of any other character set requires explicit negotiation. This character set only contains 127 different characters: English letters and numbers, punctuation characters and a few control characters. Accented letters, umlauts or other scripts are not contained in the ASCII character set.

In order to support non-English characters, the FTP specifications were extended in 1999 in RFC 2640. This extension requires the use of UTF-8 as the character set. This character set is a strict superset of ASCII, every valid ASCII character is also the same character in UTF-8. The UTF-8 character set can display any valid Unicode character. That includes umlauts, accented letters and also different scripts. This extension is fully backwards compatible with RFC 959.

As long as you're using only English characters, it doesn't matter if the software you are using supports RFC 2640 or not. However, if you use non-English characters without using RFC 2640 compatible software, there will be problems--problems which are entirely self-made by not obeying the specifications.

关于apache-nifi - Nifi ftp 失败,路径不存在,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51643416/

相关文章:

security - Apache NiFi LDAPS 配置问题

apache-nifi - Nifi执行进程处理器

apache-nifi - Apache NiFi DBCPConnectionPool ORA-00933 : SQL command not properly ended for 'select 1 from dual;'

java - NiFi开发自定义处理器: import org. apache.nifi.processors错误

redis - 使用 Apache NiFi PutDistributedMapCache 在 Redis 上设置 TTL

java - 运行 R scraper 脚本时出现 java.io.IOException 错误

hadoop - 如何使用具有指定用户的列表文件处理器读取文件

java - Apache Nifi AbstractProcessor 的 onTrigger() 方法中的零流文件

apache - Apache Nifi PutElasticsearch可以永远等待填充批处理大小吗?

docker - Nifi 1.6.0内存泄漏