E9.2 FTP Connector - No Wildcard or Directory Listing Capability

jolly

VIP Member
Hi - the Orchestration FTP Connector has a massive shortcoming: if you don't know the filename you cannot get it. You can't specify a wildcard. So if for example there are files to get that have timestamp filenames, you won't be able to get them as you don't know the filenames and can't get the filenames.

Makes the SFTP Retrieve option a bit useless, doesn't it?

Oracle need to add a 3rd option to Send and Receive on the FTP Connector: Directory Listing.
 
Hmmm, could write a custom Groovy step using org.apache.commons.net.ftp.FTPClient to get a SFTP directory listing (or do any kind of FTP work) but importing this library fails... does it need to be added to the AIS server somehow?
 
Hmmm, could write a custom Groovy step using org.apache.commons.net.ftp.FTPClient to get a SFTP directory listing (or do any kind of FTP work) but importing this library fails... does it need to be added to the AIS server somehow?
Yes, custom groovy is the workaround for this. You will need to load those custom JARs to your WebLogic LIB folder and also update your classpath settings.
 
Yes, custom groovy is the workaround for this. You will need to load those custom JARs to your WebLogic LIB folder and also update your classpath settings.
Hi Ice,

This looks promising... But I don't know where to start with the JARs and class paths... Is there a guide for this?

Thanks JohnO
 
Hi Ice,

This looks promising... But I don't know where to start with the JARs and class paths... Is there a guide for this?

Thanks JohnO
Given other Apache Commons classes such as CSV are available to orchestrator groovy coders, maybe I just need to download commons.net.jar and put it wherever commons.net.csv.jar is on the AIS server?
 
Given other Apache Commons classes such as CSV are available to orchestrator groovy coders, maybe I just need to download commons.net.jar and put it wherever commons.net.csv.jar is on the AIS server?
Hi JohnO , try the steps described in this document - assuming you have access to Oracle Support

E1: ORCH: How To Add Custom .jar file to AIS server Classpath to be used in a Custom Groovy Step (Doc ID 2770395.1)
 
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()
}
//
 
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()
}
//
Hi Harry,
I have similar requirement to do SFTP to the 3rd Party host. Can you please guide the steps, what JARs (SFTP) I need on the AIS server for the FTP?
 
The JAR files related to 'import com.jcraft.jsch.*' are what you need. You can find them on Google. Hope it helps.
 
I got exception that auth Fail after using the similar groovy code . Any idea? Can it be due to JAR files?
 
Back
Top