我正在尝试使用 Docker 映像中的vsftpd 服务器重新创建Alpakka FTP-Source 连接器的遍历示例,但似乎无法连接。任何如何调整代码的指针都将非常受欢迎:
FtpSettings ftpSettings = FtpSettings
.create(InetAddress.getLocalhost())
.withPort(21)
.withCredentials(FtpCredentials.NonAnonFtpCredentials.create("news", "test"))
.withBinary(true)
.withPassiveMode(true)
.withConfigureConnectionConsumer(
(FTPClient ftpClient) -> {
ftpClient.addProtocolCommandListener(
new PrintCommandListener(new PrintWriter(System.out), true));
});
Source<FtpFile, NotUsed> ftp = Ftp.ls("/", ftpSettings);
ftp.to(Sink.foreach(s -> LOGGER.info(s.name())));
仅供参考:登录信息正在使用例如 filezilla。