Class Reference
EnsLib.FTP.OutboundAdapter
Server:appadmin-00044-deployment-6bf4cbc86d-9f4xc
Instance:IRIS
User:SuperUser
 
-
  [USER] >  [EnsLib] >  [FTP] >  [OutboundAdapter]
Private  Storage

class EnsLib.FTP.OutboundAdapter extends Ens.OutboundAdapter, EnsLib.FTP.Common, EnsLib.File.Common

Inventory

Parameters Properties Methods Queries Indices ForeignKeys Triggers
1 4 10


Summary

Properties
%CredentialsObj %SFTPPassphraseCredentialsObj %WarnedLatest %logTransfers
BusinessHost Charset CommandTranslateTable ConnectTimeout
Credentials FTPPort FTPServer FilePath
KeepaliveInterval Overwrite Protocol RegistryID
SFTPAppendMode SFTPAuthenticationMethods SFTPFileAccessMode SFTPInteractiveDTL
SFTPLocalCharset SFTPPassphraseCredentials SFTPPrivateKeyFile SFTPPublicKeyFile
SFTPRemoteCharset SFTPSetFileAccessModeByClient SSLCheckServerIdentity SSLConfig
SSLUseSessionResumption StayConnected TranslateTable UsePASV

Methods
%AddToSaveSet %ClassIsLatestVersion %ClassName %ConstructClone
%DispatchClassMethod %DispatchGetModified %DispatchGetProperty %DispatchMethod
%DispatchSetModified %DispatchSetMultidimProperty %DispatchSetProperty %Extends
%GetParameter %IsA %IsModified %New
%NormalizeObject %ObjectModified %OriginalNamespace %PackageName
%RemoveFromSaveSet %SerializeObject %SetModified %ValidateObject
AssignOneSetting AuthenticateSSH ClearAllAppData ClearRuntimeAppData
ClearStaticAppData Connect ConnectSSH CorrespondingSemaphoreExists
CreateFilename CreateTimestamp DeepListClose DeepListExecute
DeepListFetch Delete Disconnect EnumerateSettingsClose
EnumerateSettingsExecute EnumerateSettingsFetch FileLikePattern FileListClose
FileListExecute FileListFetch FileListSSHClose FileListSSHExecute
FileListSSHFetch GenerateSemaphoreFilename GetSettings GetStream
LinkFileStream NameList NormalizeDirectory OnKeepalive
PutStream Rename SFTPPassphraseCredentialsSet SemaphoreFileExists
System TestConnection TestConnectionSSH fixPath


Parameters

• parameter SETTINGS = "RegistryID:Basic:selector?context={Ens.ServiceRegistry.External.ContextSearch/Services?Protocols_1=FTP},Overwrite,SFTPAppendMode:SFTP";
These properties can be configured or set by the associated Business Operation

Properties

• property Charset as %String [ InitialExpression = "Binary" ];
FTP - Use the named Character encoding to translate characters from the file.
A * prepended to any of the charset names will cause a binary FTP transfer with the resulting data then translated using the specified encoding.
Note that Binary should be chosen for binary files and other cases when special characters such as line terminators must be preserved.
Other settings may be useful when transferring text documents via FTP.

Choices include:
Binary - binary transfer
Ascii - Ascii mode FTP transfer but no character encoding translation
Native - the default character encoding of the installed locale of the InterSystems IRIS server
latin1 - the ISO Latin1 8-bit encoding
ISO-8859-1 - the ISO Latin1 8-bit encoding
UTF-8 - the Unicode 8-bit encoding
Unicode - the Unicode 16-bit encoding (Little-Endian)
UnicodeBig - the Unicode 16-bit encoding (Big-Endian)
@<ttable> - <ttable> means a raw InterSystems character translation table name. A prefix of '@' means to use the named table.

• property FilePath as %String(MAXLEN=1000) [ Required ];
Directory on the FTP server in which to effect FTP operations.
• property Overwrite as %Boolean [ InitialExpression = 1 ];
Overwrite output file if it exists instead of appending
• property SFTPAppendMode as %String(VALUELIST=",Client,Server") [ InitialExpression = "Client" ];
If the protocol is SFTP and Overwrite=false then you should configure SFTP Append Mode also.

If the SFTP server supports appending then you should select 'Server' append mode. Some SFTP servers do not support appending. When connecting to such a server you should select 'Client' append mode.
Click here to test server side append

In 'Client' mode the FTP adapter will retrieve the remote file (if it exists) from the server, append the new data locally, and then put the combined data back to the SFTP server.

There is a chance that some other process will remove the file from the server or modify the file on the server before the adapter puts the combined data back to the server. In this case the changes made by the other process could be lost.

The logic the SFTP adapter uses for local appending is:

  1. Check if the remote file exists
  2. If it exists it renames by adding .ToBeAppendedTo to the end of the name
  3. If it does not exist it looks for a prior name ending .ToBeAppendedTo
  4. If either of these existing files are found it is downloaded and the new data appended
  5. The combined file is put back and the prior file ending with .ToBeAppendedTo is removed
  6. If there is a network failure before putting the combined file on the server the adapter will use the .ToBeAppendedTo file on the next connection
Since the file being appended to might be locked by the SFTP server you should also consider configuring ReplyCodeActions so that the Operation retries upon error, e.g. E=R or E*Error.


Methods

• method CreateFilename(pFilename As %String, pSpec As %String, pIsVMS As %Boolean, pDirectory As %String, pLocal As %Boolean) as %String
Passthrough method for the use of BatchStandardOperation classes. Non-trivial parallel version is defined in File adapter
• method Delete(pFilename As %String) as %Status
Delete a named file from an FTP server. Server,Username,Password, and FilePath are configured as Settings for this Adapter. Returns a status value indicating the success of the FTP operation.
• method GetStream(pFilename As %String, ByRef pStream As %Stream.Object = $$$NULLOREF) as %Status
Retrieve a named file from an FTP server and return it as a stream. Server,Username,Password,FilePath and Transfer mode (Charset) are configured as Settings for this Adapter. Returns a status value indicating the success of the FTP operation. If the caller provides a stream, it must be the appropriate type of stream for the transfer (Ascii, Binary). This method will create the stream if none is provided.
• method NameList(Output pFileList As %ListOfDataTypes) as %Status
Get a list of files on an FTP server. Server,Username,Password, and FilePath are configured as Settings for this Adapter. The filenames are returned in a %ListOfDataTypes object. Returns a status value indicating the success of the FTP operation.
• method PutStream(pFilename As %String, pStream As %Stream.Object) as %Status
Store a Stream to an FTP server as a named file. Server,Username,Password,FilePath and Transfer mode (Charset) are configured as Settings for this Adapter. Returns a status value indicating the success of the FTP operation.
• method Rename(pFilename As %String, pNewFilename As %String, pNewPath As %String = "") as %Status
Rename a file on an FTP server. Server,Username,Password, and FilePath are configured as Settings for this Adapter. Returns a status value indicating the success of the FTP operation.


Copyright (c) 2025 by InterSystems Corporation. Cambridge, Massachusetts, U.S.A. All rights reserved. Confidential property of InterSystems Corporation.