4

I'm using JSch to traverse a remote directory and read all its contained files. I can retrieve the file names using the ChannelSftp.ls() method as described here.

However, trying to read the files using ChannelSftp.get(), only the first three or four files work. After that, I get the following error message:

1: End of file at com.jcraft.jsch.ChannelSftp.throwStatusError(ChannelSftp.java:2846) at com.jcraft.jsch.ChannelSftp._stat(ChannelSftp.java:2198) at com.jcraft.jsch.ChannelSftp.get(ChannelSftp.java:1294) at com.jcraft.jsch.ChannelSftp.get(ChannelSftp.java:1266) at ...

And for all subsequent files (after the first one failed with the above error), the error message is:

4: 
at com.jcraft.jsch.ChannelSftp._stat(ChannelSftp.java:2200)
at com.jcraft.jsch.ChannelSftp.get(ChannelSftp.java:1294)
at com.jcraft.jsch.ChannelSftp.get(ChannelSftp.java:1266)

I've tried different directories and different servers, so it's not about the particular file. Is that a systematic problem with JSch?

Community
  • 1
  • 1
joko
  • 49
  • 2

0 Answers0