You can use the rename command, it will move the file or directory and delete it from its original location.
sftpChannel.rename (oldFile, newFile);
Do not use this method if you want to keep the original directory / file.
Hope this helps.
source share