SFTP Smart Services

Overview

Contains multiple Smart Services for interacting with a remote file server via SFTP, FTP, or SCP.  Using these services, an Appian application can be configured to send and receive files, folders, and metadata in a process.  Features support for zlib compression.

Key Features & Functionality

Smart Services included:

  • SFTP:
    • Remove Directory Over SFTP (Basic Credentials)
    • Send File Over SFTP
    • Send File Over SFTP (Basic Credentials)
    • Receive File Over SFTP
    • Receive File Over SFTP (Basic Credentials)
    • Rename File Over SFTP
    • Get Remote Directory Contents Over SFTP
    • Get Remote Directory Contents Over SFTP (Basic Credentials)
    • Create Directory Over SFTP
    • Create Directory Over SFTP (Basic Credentials)
  • SCP:
    • Send File Over SCP
    • Receive File Over SCP
  • FTP:
    • Send File Over FTP
    • Receive File Over FTP
    • Receive Folder Over FTP
  • FTPS
    • Receive Folder Over FTPS
    • Send File Over FTPS (Basic Credentials)

All smart services in the package use Secure Credentials Store.

Anonymous
  • I'm also running into same issue 

    2020-10-12 17:52:03,309 [Appian Work Item - 10843 - execution01 : UnattendedJavaActivityRequest] ERROR com.appiancorp.process.engine.UnattendedJavaActivityRequest - An error occurred while executing activity: id=268465328, classname=com.appian.ps.plugins.sftpsmartservices.ReceiveFileOverSFTPBasic
    java.lang.StringIndexOutOfBoundsException: String index out of range: -1
    at java.lang.String.substring(String.java:1927)
    at com.appian.ps.plugins.sftpsmartservices.ReceiveFileOverSFTPBasic.run(ReceiveFileOverSFTPBasic.java:103)
    at com.appiancorp.process.runtime.framework.DefaultActivityExecutor$1.lambda$call$0(DefaultActivityExecutor.java:131)
    at com.appiancorp.plugins.PluginUsageLogger.runWithPluginInformation(PluginUsageLogger.java:52)
    at com.appiancorp.process.runtime.framework.DefaultActivityExecutor$1.call(DefaultActivityExecutor.java:131)
    at com.appiancorp.process.runtime.framework.DefaultActivityExecutor$1.call(DefaultActivityExecutor.java:125)
    at com.appiancorp.common.ContextClassLoaderSwitcher.runInContext(ContextClassLoaderSwitcher.java:25)
    at com.appiancorp.process.runtime.framework.DefaultActivityExecutor.execute(DefaultActivityExecutor.java:125)
    at com.appiancorp.process.engine.UnattendedJavaActivityRequest.execute(UnattendedJavaActivityRequest.java:83)
    at com.appiancorp.process.engine.UnattendedJavaActivityRequest.execute0(UnattendedJavaActivityRequest.java:55)
    at com.appiancorp.process.engine.ContinuationRequest.executeOuter(ContinuationRequest.java:71)
    at com.appiancorp.process.engine.ContinuationRequest.execute(ContinuationRequest.java:100)
    at com.appiancorp.process.workpoller.UnattendedRequestHandlerBean.onMessage(UnattendedRequestHandlerBean.java:36)
    at com.appiancorp.process.workpoller.WorkItem.run(WorkItem.java:93)
    at org.springframework.jca.work.SimpleTaskWorkManager$DelegatingWorkAdapter.run(SimpleTaskWorkManager.java:239)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)

    Code at 103: ReceiveFileOverSFTPBasic

    if (documentName.lastIndexOf('.') == -1)
    documentName += remote_filename.substring(remote_filename
    .lastIndexOf('.'));

  • I see that there is a single Send File over FTP, but there doesn't seem to be a smart service for sending a single file over FTPS.  This would most likely have to be an enhancement to the plugin.

  • Can you include the stack trace from the tomcat-stdout.log to get more information on what is throwing this exception?

  • Is your variable that you are saving the output of the rule into a multiple? That smart service returns two arrays files[] and directories[]

  • This function is simply running an ls command on the SFTP server.  Then it loops through each of the contents and runs the following logic:

    If content.getLongname() start with d then add to the directory array, otherwise add to file array (unless ".." or "." which are filtered out)

    Are you checking both of the output arrays (documents and files)?

    I would test with an SFTP client like WinSCP and see if you have the same issue.  It may be a user permission issue on those files.

  • There is a limit of the smart service of an hour, but no specific timeout set in the code for the plug-in.  

    That being said, an 18GB is very large - what are your plans for using it in Appian?  Additionally, it will use up a lot of Appian's disk space.

  • Hi Team,

    Using the "Retrieve Files in Folders over FTPS", i was able to download all files from folder when i specify the folder path.

    But if i specify a single file along with it's path, then the file is downloading as <1 KB file and not able to download and open.

    Please help me , on how to download single file using this plugin ?

    Thanks in advance....

  • I am using v2.0 I am not able to receive file by using "Receive File Over SFTP (Basic Credentials). 

    It is giving error, "String index out of range : -1".

    "Send File Over SFTP (Basic Credentials) " is working fine and I am able to send file to the remote site.

    Any help on this will be appreciated.

    Thanks 

  • I am able to receive single file using "Get Remote Directory Contents Over SFTP". How to receive multiple files?

  • I am trying to get remote directory contents and facing one issue:

    It is returning all the directories name under that folder but it is not returning the file names. Is anyone else is also facing the same issue? Also one strange thing happened, with the same configuration, it was able to return the file name for once. Node is not braking or giving any error.