Is it possible to invoke sftp outbound endpoint, and send a file, through the code?
I have a reference to a File object in java code (in a custom transformer), and I want to invoke sftp outbound endpoint and pass that File reference. Is this doable?
Thanks.
Is it possible to invoke sftp outbound endpoint, and send a file, through the
Share
Pass it a
FileInputStream, that should work.If not, you’ll have to pass it a
byte[].Note that
dispatchis asynchronous: the call will return immediately while the SFTP communication occurs. if you want to wait until it’s done, usesendwith a time-out as last parameter.Since you have several SFTP connectors configured, you’ll have to specify the connector name in the URL. Supposing you want to dispatch using
SFTP_Upload_Connector, you’ll have to use:If you want to set a particular destination file name, pass it as a property named
filenamein the properties map, for example using: