Re: [JSch-users] SCP to SFTP file streaming
Status: Alpha
Brought to you by:
ymnk
|
From: Lothar K. <jo...@ki...> - 2019-04-12 10:30:35
|
Am 12.04.2019 um 08:42 schrieb Sensen, Andreas:
> ChannelExec channel = (ChannelExec) session.openChannel("exec");
>
> …
that part would be interesting as well in order to give an answer.
> InputStream sshInputStream = channel.getInputStream();
Aftersending a "scp -f filename" the scp-command starts with an information
about the lenght of the file to be transfered. You should read that and keep
that information for the next step.
Here you should wrap the returned inputstream into an own InputStream
that uses the above size-information to return -1 as soon as the announced
number of bytes has been reached.
Cheers, Lothar
|