We added the library jar file to the server and we are able to do SFTP send and receive files. FYI - We use P952000 Cross Reference to pass some parameters.
Let me share some Groovy coding as example here.
-----------------
import com.oracle.e1.common.OrchestrationAttributes;
import java.text.SimpleDateFormat;
import groovy.json.*;
import java.io.Reader;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.io.ByteArrayInputStream
import com.jcraft.jsch.*
HashMap<String, Object> main(OrchestrationAttributes orchAttr, HashMap inputMap)
{
HashMap<String, Object> returnMap = new HashMap<String, Object>();
// Add logic here
strPassword ='yourpassword'
strSourceFilePath='yourSFTPsubFolder'
java.util.Properties config = new java.util.Properties()
config.put("StrictHostKeyChecking", "no")
JSch ssh = new JSch()
Session sess = ssh.getSession(strUserName, strHostName, iPort)
sess.setConfig(config)
sess.with{
setPassword strPassword
connect()
Channel chan = openChannel "sftp"
chan.connect()
ChannelSftp sftp = (ChannelSftp) chan;
//sftp.cd(strSourceFilePath)
sftp.cd(strSourceFilePath)
//sftp.cd("/SB/") //good example
sftp.put(strNewFilePathName, strSourceFileName)
// sftp.put('\\\\abcd.com\\data\\Common\\PositivePay\\Test\\*.txt',strSourceFileName)
chan.disconnect()
disconnect()
}
//