Return SSH connection from Java snippet.

Hi all,

In my case, I cannot use SSH nodes. However, when I use Java snippet to code SSH and read files from SFTP, it works fine.

But the approach I am taking, I have to write the flow for each kind of file to read from SFTP. It can be any file.

I am thinking of having Java Snippet alternate of (just) SSH node, and it should return Connection with the folder path that somehow I can use in List files and Folder and with that, I can use respective file reader or writer.

Is this possible?

I tried doing it (I don’t know if what I am doing is correct), but I got stuck and didn’t know how to proceed.