在我的Scala代码中,我有:
val ftpApi: FtpApi[SSHClient, SftpSettings]
val futureResult = ftpApi.ls(basePath = path, connectionSettings = settings)
这将生成以下输出:
11:53:36.875 [sshj-Reader-/200.13.144.60:181] DEBUG net.schmizz.sshj.transport.TransportImpl - Setting active service to null-service
11:53:36.875 [sshj-Reader-/200.13.144.60:181] DEBUG net.schmizz.concurrent.Promise - Setting <<transport close>> to `SOME`
11:53:36.875 [sshj-Reader-/200.13.144.60:181] DEBUG net.schmizz.sshj.transport.Reader - Stopping
[ERROR] [02/27/2023 11:53:36.876] [default-akka.actor.default-blocking-io-dispatcher-21] [akka://default/system/Materializers/StreamSupervisor-0/flow-0-2-sFtpBrowserSource] Error during postStop in [akka.stream.alpakka.ftp.impl.FtpBrowserGraphStage$$anon$1-sFtpBrowserSource]: Broken transport; encountered EOF
net.schmizz.sshj.connection.ConnectionException: Broken transport; encountered EOF
at net.schmizz.sshj.connection.ConnectionException$1.chain(ConnectionException.java:32)
at net.schmizz.sshj.connection.ConnectionException$1.chain(ConnectionException.java:26)
at net.schmizz.concurrent.Promise.deliverError(Promise.java:95)
at net.schmizz.concurrent.Event.deliverError(Event.java:74)
at net.schmizz.concurrent.ErrorDeliveryUtil.alertEvents(ErrorDeliveryUtil.java:34)
at net.schmizz.sshj.connection.channel.AbstractChannel.notifyError(AbstractChannel.java:239)
at net.schmizz.sshj.connection.channel.direct.SessionChannel.notifyError(SessionChannel.java:229)
at net.schmizz.sshj.common.ErrorNotifiable$Util.alertAll(ErrorNotifiable.java:35)
at net.schmizz.sshj.connection.ConnectionImpl.notifyError(ConnectionImpl.java:261)
at net.schmizz.sshj.transport.TransportImpl.die(TransportImpl.java:588)
at net.schmizz.sshj.transport.Reader.run(Reader.java:66)
Caused by: net.schmizz.sshj.transport.TransportException: Broken transport; encountered EOF
at net.schmizz.sshj.transport.Reader.run(Reader.java:58)
我期望这将列出sftp中的文件。
1条答案
按热度按时间pn9klfpd1#
我看到你有
FtpApi
,但是有SftpSettings
,你可以直接用对于FTP:
对于SFTP:
Alpakka(S)FTP实现有一些怪癖,不管怎样,this working SFTP example是一个展示可能性的尝试。