EnsLib.FTP.OutboundAdapter
class EnsLib.FTP.OutboundAdapter extends Ens.OutboundAdapter, EnsLib.FTP.Common, EnsLib.File.Common
Property Inventory
Method Inventory
Parameters
Properties
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.
Click here to test server side appendOpens in a new tab 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:
- Check if the remote file exists
- If it exists it renames by adding .ToBeAppendedTo to the end of the name
- If it does not exist it looks for a prior name ending .ToBeAppendedTo
- If either of these existing files are found it is downloaded and the new data appended
- The combined file is put back and the prior file ending with .ToBeAppendedTo is removed
- 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
Allows you to indicate that the data file or files are complete and ready to be read by creating an associated second file in the same directory that is used as a semaphore.
If the Semaphore Specification is an empty string, the adapter will not create a semaphore file.
SYNTAX: Semaphore Specification can be an empty string or can be a series of pairs, each of which associates a data filename pattern with a semaphore filename pattern. The pairs are separated by semicolons:
DataFileSpec=SemaphoreFileSpec;DataFileSpec=SemaphoreFileSpec;...
DataFileSpec is either a plain filename or a filename specification that includes the * wildcard (which matches any character). SemaphorePattern directly or indirectly specifies the name of the associated semaphore file; it can be either of the following:
- A plain filename (such as SemaphoreFile.SEM). In this case, when the system finds a file that matches DataFileSpec, the system looks for a file with that exact name.
- A string of the form *.extension such as *.sem. In this case, when the system finds a file that matches DataFileSpec, the system looks for a file with the same name, but with the sem extension instead. For example, if the filename ABCDEF.txt matches DataFileSpec, the system looks for a semaphore file named ABCDEF.sem. When looking for a semaphore file based on a data filename, the system looks only at the part of the data filename before the first period. For example, if the filename test.txt.data.zip.tar matches DataFileSpec, if the semaphore filename pattern is *.sem the system looks for a semaphore file named test.sem
- The semaphore file associated with a given data file (or multiple data files) will be put in the same directory as those files.
- DataFileSpec and SemaphoreFileSpec do not include the directory name.
- DataFileSpec is always case-sensitive.
- SemaphoreFileSpec is case-sensitive if the operating system is case-sensitive and is not case-sensitive otherwise. Thus, you should be aware of the details of the system that you are writing to.
- The pairs are processed left-to-right, and the first matching pair is used; see below. Consequently, if you are including multiple specifications that can match the same file, you should specify the more specific specification before the more general ones.
- Trailing or leading whitespace is removed, but not whitespace within the string. In other words, *.txt=*.sem;*.md=*.mdsem is not the same as *.txt=*.sem; *.md=*.mdsem
FILENAMES THAT DO NOT MATCH A PATTERN: If a Semaphore Specification is specified and a given data file does not match any of the patterns, then no semaphore file will be created. If downstream systems are expecting a semaphore file, this may cause them to not properly handle the file. If this is undesirable, specify a final pair that will match any file. For example, consider this Semaphore Specification:
*.DAT=*.SEM;*.DOC=*.READY;*=SEM.LAST
The SEM.LAST is the semaphore file for all files that do not end with .DAT or .DOC.
HOW THE ADAPTER USES SEMAPHORE SPECIFICATION: When a file is going to be put onto a server, the adapter will check the filename to see if there is a match in the Semaphore Specification. If there is, it will put the file onto the server and then put a semaphore file onto the server, with a filename that matches the appropriate Semaphore Specification. If there is no match, the adapter will not create a semaphore file. If this happens, we will log a warning the first 5 times. This number can be tuned by changing the Semaphore Miss Threshold property.
Methods
dirname is the name of the directory to create
dirpath is the path to the directory that we intend to create. If not supplied, path to the current directory is used.
SFTPFilemode is the file mode of the directory. This is only applied if the protocol is SFTP.
ByRef output FTP will return information about the name of the directory created in case there is some discrepancy. If an output variable is supplied, that return information will be stored within it.
Returns a status effect indicating whether the operation succeeded or failed.
Inherited Members
Inherited Properties
- %CredentialsObj
- %SFTPPassphraseCredentialsObj
- %WarnedLatest
- %logTransfers
- BusinessHost
- CommandTranslateTable
- ConnectTimeout
- Credentials
- FTPPort
- FTPServer
- KeepaliveInterval
- MLSD
- Protocol
- RegistryID
- SFTPAuthenticationMethods
- SFTPFileAccessMode
- SFTPInteractiveDTL
- SFTPKexAlgorithm
- SFTPLocalCharset
- SFTPPassphraseCredentials
- SFTPPrivateKeyFile
- SFTPPublicKeyFile
- SFTPRemoteCharset
- SFTPSetFileAccessModeByClient
- SSLCheckServerIdentity
- SSLConfig
- SSLUseSessionResumption
- StayConnected
- TranslateTable
- UsePASV
- UseRegex
Inherited 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()
- BetterParseMLSD()
- ClearAllAppData()
- ClearRuntimeAppData()
- ClearStaticAppData()
- Connect()
- ConnectSSH()
- CorrespondingSemaphoreExists()
- CreateTimestamp()
- DateCreatedCompare()
- DeepListClose()
- DeepListExecute()
- DeepListFetch()
- Disconnect()
- EnumerateSettingsClose()
- EnumerateSettingsExecute()
- EnumerateSettingsFetch()
- FileLikePattern()
- FileListClose()
- FileListExecute()
- FileListFetch()
- FileListSSHClose()
- FileListSSHExecute()
- FileListSSHFetch()
- FileStringParseMLSD()
- GenerateSemaphoreFilename()
- GetSettings()
- LastModifiedCompare()
- LinkFileStream()
- NameCompare()
- NormalizeDirectory()
- OnKeepalive()
- SFTPPassphraseCredentialsSet()
- SemaphoreFileExists()
- SizeCompare()
- System()
- TestConnection()
- TestConnectionSSH()
- fixPath()
- handleLIST()
- handleMLSD()