Manages FTP and SFTP connections opened by app scripts, enforcing a per-tenant limit on concurrent connections. Registered as the "ftpManager" service, so app developers reach it from server-side JS as ftpManager. Call openFtp or openSFtp to obtain a FtpSession for uploading, downloading or listing files on a remote server; sessions are tracked per tenant and force-closed by a background worker after a maximum duration if they are not closed explicitly.
Group: Managers
Properties
| Property | Returns | Description |
|---|---|---|
| tenantConnectionCount | int |
Methods
openFtp(String address, String user, String pass, String security, boolean isImplicit)
Returns: FtpSession
Opens an FTP or FTPS connection to a remote server and logs in, throwing if the tenant already has the maximum number of concurrent connections open. The returned session is tracked for this tenant and will be force-closed after a maximum duration even if the caller never closes it.
| Parameter | Description |
|---|---|
address | the server URL to connect to, for example ftp://111.222.111.222/Inbound |
user | the user id to log in with |
pass | the password to log in with |
security | the encryption mode, either SSL, TLS or null for plain FTP |
isImplicit | true to use implicit FTPS, false to use explicit FTPS; ignored for plain FTP |
openSFtp(String address, String user, String pass, String privateKey)
Returns: FtpSession
Opens an SFTP connection to a remote server, authenticating with a private key if one is supplied or with a password otherwise, throwing if the tenant already has the maximum number of concurrent connections open. The returned session is tracked for this tenant and will be force-closed after a maximum duration even if the caller never closes it.
| Parameter | Description |
|---|---|
address | the server URL to connect to |
user | the user id to authenticate with |
pass | the password to authenticate with; ignored when privateKey is supplied |
privateKey | a PEM-encoded private key to authenticate with, or blank to authenticate with pass instead |