220221222223224225226227228229230
session.connect(); ByteArrayOutputStream out = new ByteArrayOutputStream(); ChannelSftp c = (ChannelSftp) session.openChannel("sftp"); c.connect(); c.get(path,out); c.disconnect(); session.disconnect(); new String(); return new String(out.toByteArray()); } }
159160161162163164165166167168169
try { // maybe the channel has some problems, so recreate the channel and retry if (e.id != ChannelSftp.SSH_FX_NO_SUCH_FILE) { channel.disconnect(); channel = getAbstractFileSystem().getChannel(); setStat(channel.stat(relPath)); } else {