这在某些文件上发生,但在其他文件上没有 .

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)

代码很简单:

jsch.addIdentity("privateKeyFromOdin", sftpPrivateKey, null, null);
        session = jsch.getSession(SFTPUSER, SFTPHOST, SFTPPORT);
        Properties config = new Properties();
        config.put("StrictHostKeyChecking", "no");
        session.setConfig(config);
        session.connect();
        Channel channel = session.openChannel("sftp");
        channel.connect();
        channelSftp = (ChannelSftp) channel;

        Vector<ChannelSftp.LsEntry> ls = channelSftp.ls(".");
        for (ChannelSftp.LsEntry entry : ls) {
                String fileName = entry.getFilename();
                encryptedStream = channelSftp.get(fileName);//Exception thrown here
        }

更奇怪的是,这曾经很好用 . 但我不知道发生了什么变化 .