Loading...

FTP command service

Table of Contents

    FTP command service

    The FTP Command Service makes it possible to send one of the following commands to an (s)FTP(s) Server:

    Command Options

    Description

    Return value

    ls

     

    The ls command gives back information about the files in the given remote directory.

    The return value is a list of FileInfo objects.

     

    -1

    Only returns a list of the filenames in the given remote directory.

    The return value is a list of Strings.

     

    -a

    Executes ls on all files in the remote directory (also hidden files).

    The return value is a list of FileInfo objects.

     

    -f

    Does not sort the retreived list.

    The return value is a list of FileInfo objects.

     

    -dirs

    Also returns the folders in the remote directory.

    The return value is a list of FileInfo objects.

     

    -links

    Also returns symbol links in the remote directory.

    The return value is a list of FileInfo objects.

     

    -R

    Executes the command recursively, files in subfolders are also returned.

    The return value is a list of FileInfo objects.

    get

     

    Retrieves a file from the FTP Server.

    The return value is a File.

     

    -P

    Retains the original timestamp on the external file.

    The return value is a File.

    mget

     

    Retreives multiple files from the FTP Server via a pattern or regex.

    The return value is a list of File Objects.

     

    -P

    Retains the original timestamps on the external files.

    The return value is a list of File Objects.

     

    -x

    Returns an exception when no files satisfy the filter. If this is not used an empty list is used in that case.

    The return value is a list of File Objects.

    rm

     

    With this command a File can be removed from the FTP Server. The filename has to be entered for this.

    You can remove only one file at a time.

    The return value is a Boolean
    (‘true’ if the file is succesfully removed).

    mv

     

    With this command a file can be moved on the FTP Server. You can choose to use the move-target-filename properties for the new filename, if the old filename is used, these properties don’t have to be entered and the remote-filename will be used.

    You can move only one file at a time.

    The return value is a Boolean
    (‘true’ if the move has been succesful).

     

    Depending on the chosen command and potential command-options the response can for instance be a FileInfo Object for the ls command or a Boolean for the rm command.

    General functionality

    Attribute

    Description

    Name*

    By default, we fill this out with the technical ‘tag’, followed by a serial number. Changing the name is optional.

    Enabled

    Check this box if you want this service to be enabled.

    FTP Type

    Type of FTP connection. You can choose FTP, FTPS or sFTP

    FTP Host*

    FTP server Hostname.

    FTP Port

    FTP server port. The default is 21, or 22 for sFTP. Override this port number if necessary.

    FTP Username*

    FTP server username.

    FTP Password*

    FTP server password.

    FTP Mode

    FTP server mode, either Active or Passive.

    FTP FileType

    FTP server file type, either ASCII, Binary or EBCDIC.

    Remote-Directory

    Remote directory path on FTP server. The default value will be '/'.

    Only one of the following fields may contain any data:

    • Remote-Directory
    • Remote-Directory-From-Header

    Remote-Directory-From-Header

    This header specifies remote directory path.

    Only one of the following fields may contain any data:

    • Remote-Directory
    • Remote-Directory-From-Header
    Remote-File-Separator Specify file separator character. The default is '/'.
    MessagePart-In Name of the MessagePart in a ConnectMessage where the content of the file is being stored.

    MessagePart-Out

    Name of the MessagePart to which the content should be written.
    Filename-Extension

    Here, you can define the files’ extension. The default is '.xml'.

    Specify File-name Use the content of this header attribute as the file name. File-consumer and FTP-consumer will set original file name in header attribute file_name. Default header attribute for file_name is connectmessageID.

    Session Reuse

    This indicates the reusing of TLS session when connecting to FTPS. Defaults to true.

    Description

    Description of the specific service. This is for documentation purposes.

    LS Functionality

    In the table below, you will find an explanation about these properties. All attributes with a ‘*’ are mandatory.

    Attribute

    Description

    Command-Options

    See table above for an overview of possible options.

    Temporary-File-Suffix

    Add the suffix which is used in creating the temporary file.

    GET Functionality

    In the table below, you will find an explanation about these properties. All attributes with a ‘*’ are mandatory.

    Attribute

    Description

    Local-Directory

    If the command ‘(m)get’ is used, you can specify the location where the files of the ‘(m)get’action have to be saved here. This can be a relative path. Files that are saved to this folder remain here after downloading.

    Command-Options

    See table above for an overview of possible options.

    Local-Filename-Generator-Expression

    Add an expression that is used for creating the filename of a downloaded file. For example: #remoteFileName.toUpperCase().

    Temporary-File-Suffix

    Add the suffix which is used in creating the temporary file.

    Remote-Filename

    Specify a fixed name for the remote file.

    Only one of the following fields may contain any data:

    • Remote-Filename
    • Remote-Filename-From-Header

    Remote-Filename-From-Header

    Name of the header property in the ConnectMessage which is used to generate the filename. If you enter file_name, the original filename is used. By default a unique ID is used.

    Only one of the following fields may contain any data:

    • Remote-Filename
    • Remote-Filename-From-Header

    MGET Functionality

    In the table below, you will find an explanation about these properties. All attributes with a ‘*’ are mandatory.

    Attribute

    Description

    Local-Directory

    If the command ‘(m)get’ is used, you can specify the location where the files of the ‘(m)get’action have to be saved here. This can be a relative path. Files that are saved to this folder remain here after downloading.

    Command-Options

    See table above for an overview of possible options.

    Local-Filename-Generator-Expression

    Add an expression that is used for creating the filename of a downloaded file. For example: #remoteFileName.toUpperCase().

    Temporary-File-Suffix

    Add the suffix which is used in creating the temporary file.

    Remote-Filename-Pattern

    Specify a pattern for the remote filename.

    Remember to fill one of the to fields:

    • Remote-Filename-Pattern
    • Remote-Filename-Regex

    If both fields are empty, nothing will be read.

    When using a filename pattern and there are more than one files which apply to the pattern, the system will choose only one file to read. If you want to read both files, use either mget or remove the file you read with a mv command or use get again.

    Remote-Filename-Regex

    Specify a regular expression for the remote filename.

    Remember to fill one of the to fields:

    • Remote-Filename-Pattern
    • Remote-Filename-Regex

    If both fields are empty, nothing will be read.

    When using a filename pattern and there are more than one files which apply to the pattern, the system will choose only one file to read. If you want to read both files, use either mget or remove the file you read with a mv command or use get again.

    MV Functionality

    Attention: You can move only 1 file at a time.

    In the table below, you will find an explanation about these properties. All attributes with a ‘*’ are mandatory.

    Attribute

    Description

    Temporary-File-Suffix

    Add the suffix which is used in creating the temporary file.

    Move-Target-Directory

    If the ‘move’ command is used, you can specify the location to where the files are being moved.

    Only one of the following fields may contain any data:

    • Remote-Directory
    • Remote-Directory-From-Header

    Move-Target-Directory-From-Header

    If the ‘move’ command is used, you can specify the name of the MessageProperty of the directory the files must be moved to. With this, you can dynamically set the location. You can specify this property through a header-enricher.

    Only one of the following fields may contain any data:

    • Remote-Directory
    • Remote-Directory-From-Header

    Move-Target-Filename

    If the 'move' command is used, you can set the name that the file should get after the move. If this field and the Filename From Header are not used, the remote filename is used as filename.

    Only one of the following fields may contain any data:

    • Move-Target-Filenam
    • Move-Target-Filenam-From-Header

    Move-Target-Filename-From-Header

    If the move command is used, you can enter the name of the MessageProperty, that specifies what the name of the moved file should be, here. You can specify this property through a header-enricher.

    Only one of the following fields may contain any data:

    • Move-Target-Filenam
    • Move-Target-Filenam-From-Header

    Remote-Filename

    Specify a fixed name for the remote file.

    Only one of the following fields may contain any data:

    • Remote-Filename
    • Remote-Filename-From-Header

    Remote-Filename-From-Header

    Name of the header property in the ConnectMessage which is used to generate the filename. If you enter file_name, the original filename is used. By default a unique ID is used.

    Only one of the following fields may contain any data:

    • Remote-Filename
    • Remote-Filename-From-Header

    RM Functionality

    Attention: You can move only 1 file at a time.

    In the table below, you will find an explanation about these properties. All attributes with a ‘*’ are mandatory.

    Attribute

    Description

    Temporary-File-Suffix

    Add the suffix which is used in creating the temporary file.

    Remote-Filename

    Specify a fixed name for the remote file.

    Only one of the following fields may contain any data:

    • Remote-Filename
    • Remote-Filename-From-Header

    Remote-Filename-From-Header

    Name of the header property in the ConnectMessage which is used to generate the filename. If you enter file_name, the original filename is used. By default a unique ID is used.

    Only one of the following fields may contain any data:

    • Remote-Filename
    • Remote-Filename-From-Header

     

    Using sFTP

    Notice!

    sFTP is only supported on LINUX operating systems. Windows servers do not have any native SSL support available. You can setup a SSL Service on windows using third party products, it may work, but it is not officially supported. 

    Using sFTP for the FTP Type, you are using SSH as the underlying security protocol. The next options will become available to you.

    Attribute Description
    SFTP Private-key Specify the location of the SFTP private key file. This must be in an URL format using file:, http: or classpath: prefix.
    SFTP Private key Passphrase Passphrase for the SFTP private key file
    SFTP Server Alive Countmax SFTP server alive countmax, which is the maximum amount of messages send before being disconnected.
    SFTP Server Alive Interval SFTP server alive interval in miliseconds between 2 aserver alive messages.
    SFTP Socket TIme-out SFTP socket time-out. The default value is 0, which means there is no time-out.
    SFTP Key Exchange SFTP Key Exchange configuration for SSH Client. When a specific set of cipher keys is required you can override it here. You may also use the system-wide property -D sftpKexConfiguration=''

     

    You can upload your SFTP private key to the resrouces via the Constructor. Drag the key to the SFTP Private Key field to add the key reference.

    Overrideable Properties

    When configuring a (s)FTP(s) Producer, Service or Command Gateway you may override certain properties at runtime by specifying certain headers. The properties you can override at runtime are:

    • Username by specifying ftp_username
    • Password by specifying ftp_password
    • Host by specifying ftp_host
    • Port by specifying ftp_port

    When one or more of these properties are present in the ConnectMessage's Headers, the configured setting will be overridden at runtime.


    Copyright © 2018 ConnectPlaza.   For pricing, account management and more go to https://www.connectplaza.com

    About Connectplaza

    Si components version:   

    Lorem ipsum delore set

    Lorem ipsum delore set

    Window size is not optimal. Please enlarge for optimal experience

    No connection

    No response from the server. This window will automaticly disappear by an valid connection