Reputation: 627
I am using this JSch library (http://www.jcraft.com/jsch/) in my ColdFusion application. My application wants to implement a retry mechanism – if a file transfer fails halfway through then I want to resume (or continue) the file transfer from where it left off. Is this possible to achieve using this JSch library?
Upvotes: 1
Views: 1371
Reputation: 202534
Just reconnect and start an upload again with RESUME
flag:
channelSftp.put(src, dst, ChannelSftp.RESUME);
The RESUME
flag will make JSch query size of a partial remote file and restart the transfer from there. If the file is already uploaded completely, it transfers nothing.
Upvotes: 2