JSch jsch = new JSch();
jsch.setKnownHosts(sftpKnownHost);
jsch.addIdentity(sftpPrivateKey, sftpPrivateKeyPassphrase);
Session jschSession = jsch.getSession(sftpUser, sftpHost, sftpPort);
java.util.Properties config = new java.util.Properties();
config.put("StrictHostKeyChecking", "no");
jschSession.setConfig(config);
jschSession.connect();
ChannelSftp channelSftp = (ChannelSftp) jschSession.openChannel("sftp");
channelSftp.connect();
channelSftp.cd(fileLocation);
channelSftp.get(scrOnDirectory, desOnLocalSystem);
So on get() I am able to get the file but it gets deleted on server
I also tried just getting file and putting data in inputstream and then using Files copy but the file gets deleted even if I put data I call get() and don't copy the file
On filezilla as well I am able to download but file there is not getting deleted
Kindly help in this