com.tibco.ax.fw.runtime.transport.ftp

## Interface FTPClient

-     public interface FTPClient

  FTPClient interface models an FTP client that can connect to an FTP server. FTPClient exposes the command defined in the FTP specification (RFC 959 and QUOTE command from RFC 1123, AUTH from RFC 2228). The FTP specification is available at:

  >      http://www.ietf.org/rfc/rfc0959.txt?number=959

  QUOTE command is defined in section 4.1.4.2 of the following RFC specification:

  >      http://www.ietf.org/rfc/rfc1123.txt?number=1123

  Only the commands specified in RFC959 can be passed in QUOTE.

  FTPClient can operate either in secure mode or in unsecure mode. When secure mode is selected, both the control and data connection are secured so that no one can snoop on the transmission. Secure mode is enabled by calling `setSecureMode(boolean)`, setting the SSL Certificate Name in the Credentials tab of the trading partner, and specifying the Certificate Name as the argument to `setSSLCertificate(java.lang.String)`. If the secure FTP server supports Client Authorization, users set the Host Private Key Name as specified in the Credentials tab of the host and invoke `setSSLHostKey(java.lang.String)` providing the Key Name as the argument.

  Users of this interface will be given an FTPClient object through the Job variable. One can get this object inside EcmaScript or JavaScript as shown below:

  >     var ftpClient = job.get("ftpObj");
  >      ftpClient.connect();
  >      Your logic ...
  >      ftpClient.disconnect();

  This ftpClient object is available only during the duration of the script and is not a serializable or persistent object. Once the ftpClient object is obtained, users can call any of the methods described in the interface below if they have not configured for file transfer through an http proxy server. All the commands are supported if the connection is configured with a non-http proxy (e.g. socks4 or socks5).

  If the configuration is set to send FTP using HTTP proxy server, only the following commands are allowed: `getUsername()` , `getPassword()`, `getHost()`, `getPort()`, `connect()`, `disconnect()` , `useProxyServer()` , `executeTypeCmd(java.lang.String)`, `executeGetCmd(java.lang.String)` and `executePutCmd(java.lang.String)`

  Apart from the ftpObj job variable, there are few variables to get information relating to local directories, filenames, trading partner, and trading host name.

  The variables that are available for the FTP transport configured in trading partner outbound transports (FTP outbound) are: To get the directory of the file (in cases where the payload is referenced by a file) located in the local directory, you can use

  >       var srcPath = job.get("srcFilePath");

  To get the filename (in cases where the payload is referenced by a file) located in the local directory, you can use

  >       var srcFile = job.get("srcFileName");

  To get the data object, which is not referenced by a filename

  >       var dataObject = job.get("dataObj");

  To get the trading partner name

  >       var tpName = job.get("tpName");

  To get the trading host name

  >       var hostName = job.get("hostName");

  The variables that are available for the FTP inbound transport configured in business agreements (FTP inbound) are: To get the temporary directory, where the file(s) will be downloaded from the FTP server, you can use

  >       var getTmpDir = job.get("getTmpDir");

  To get the trading partner name

  >       var tpName = job.get("tpName");

  To get the trading host name

  >       var hostName = job.get("hostName");

  PGP Handling is also supported in FTP script, when it is nither SSL (FTPS) nor SSH FTP session. To get the PGP handler for outbound FTP (FTP PUT), an instance of interface `IOBScriptPGPHandler`, and set the PGP process options:

  >      var obPGPHandler = job.get("obPGPHandler");
  >      var sign = ...
  >      var encrypt = ...
  >      var compress = ...
  >      //sign, encrypt and compress are boolean values (true or false);
  >      obPGPHandler.setPGPOptions(sign, encrypt, compress);

  You can also set the compression algorithm as well as the format of the resulting PGP package:

  >      obPGPHandler.setCompressionAlgo("ZLIB");         //"ZLIB" or "ZIP"
  >      obPGPHandler.setFormat("armored");               //"armored" or "binary"

  Finally package the payload using PGP:

  >      obPGPHandler.packageMessage();

  All these PGP settings in FTP script overwrite the configuration in trading partner outbound transports (FTP outbound). The PGP keys used for PGP processing in FTP outbound are configured in business agreements's Document Exchange.

  To get the PGP Handler for FTP inbound (FTP GET), an instance of interface `IIBScriptPGPHandler`, and set the inbound PGP processing policy:

  >      var ibPGPHandler = job.get("ibPGPHandler");
  >      var policy = ...                                 //options: "None", "Must Encrypt", "Must Sign", "Must Sign and Encrypt", "Pass-through"
  >      ibPGPHandler.setPGPPolicy(policy);

  You might also need to set the operaton id for audit log of PGP processing.

  >      ibPGPHandler.setOperationID(...);

  Finally unpackage the received file:

  >      var tmpDir = job.get("getTmpDir");
  >      var filename = reply.getFileName();
  >      var filefullname = tmpDir + fileName;
  >      ibPGPHandler.unpackageMessage(filefullname);

  The "reply" is a FTPReply instance returned back from FTP Get operation (such as `executeGetCmd(java.lang.String)`).

  After the PGP processing, the unpackaged payload is consumed by BusinessConnect inbound process, just like the payloads from other transports.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `ACTIVE_MODE` FTP active mode to be set so that FTP client can listen on a port and send the ip and port information through the use of PORT FTP command
    `static java.lang.String` | `ALL_FILE_LIST` Optional, it can be used by business protocols during post processing messages.
    `static java.lang.String` | `COMMON_ALL_FILE_LIST` Optional, it can be used by business protocols during post processing messages.
    `static java.lang.String` | `DATA_OBJ` If the payload exists in memory and therefore it is not referenced by a filename, this slot holds the object, which can be retrieved through the method get("dataObj").
    `static int` | `DEFAULT_FTP_PORT`
    `static java.lang.String` | `DELETE_FILE` Currently not used.
    `static java.lang.String` | `DOCUMENT_ID` The document ID of the message.
    `static java.lang.String` | `FTP_OBJ` The name of the slot, which returns the ftp client itself.
    `static int` | `FTP_STATUS_ERROR` Generic failure, possibly due to unknown reasons.
    `static int` | `FTP_STATUS_OK` Generic successful completion.
    `static java.lang.String` | `HOSTNAME` The host name
    `static java.lang.String` | `IBPGP_HANDLER` The Inbound PGPHandler name
    `static java.lang.String` | `INPUT_SOURCE_DIR` For FTP Get this is the path where the fetched files are to be stored
    `static java.lang.String` | `LOG_OBJ` The log client extension handle for custom scripts to log.
    `static java.lang.String` | `OBPGP_HANDLER` The Outbound PGPHandler name
    `static java.lang.String` | `OPERATION_ID` The operation ID of the message.
    `static java.lang.String` | `ORIG_FILE_NAME` Optional, it can be used by business protocols to indicate the original file name location of a file reference.
    `static java.lang.String` | `ORIG_FILE_PATH` Optional, it can be used by business protocols to indicate the original path of a file reference.
    `static java.lang.String` | `OUTPUT_SOURCE_DIR` For FTP Put this is the path where the referenced file is taken from.
    `static int` | `PASSIVE_MODE` FTP passive mode to be set so that FTP server can listen on a port and send the ip and port information to the FTP client when the client issues PASV command.
    `static java.lang.String` | `RETRY_SLOT` The value "true" or "false" depending on whether the custom script wants BusinessConnect to re-execute itself.
    `static java.lang.String` | `SRC_FILE_NAME` The file name used specifically for outbound referenced payload.
    `static java.lang.String` | `TPNAME` The partner name
    `static java.lang.String` | `TRANSACTION_ID` The transaction ID of the message.
    `static java.lang.String` | `USER_STATUS_CODE` The custom script can return a status code in this slot.
    `static java.lang.String` | `USER_STATUS_MSG` The custom script can return a status message in this slot.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `aeTrace(java.lang.String role, java.lang.String msgcode, java.lang.String desc, java.lang.String trackingInfo)`
    `FTPReply` | `connect()` Connects to the FTP server using the user, password, and port specified in the configuration for non-proxy connections.
    `void` | `disconnect()` Disconnects from the FTP server by sending the QUIT command for non proxy connections.
    `FTPReply` | `executeAppendCmd(java.lang.String filename)` Sends APPE command to the FTP server to store the contents of the file under the name `filename` on the FTP server.
    `FTPReply` | `executeCdCmd(java.lang.String pathname)` Sends CWD command to the FTP server and returns the reply.
    `FTPReply` | `executeDelCmd(java.lang.String filename)` Sends DELE command to the FTP server to delete the filename specified in `filename` parameter.
    `FTPReply` | `executeDirCmd(java.lang.String pathname)` Sends LIST command to the FTP server and receives the list of directory listing for that current pathname.
    `FTPReply` | `executeGetCmd(java.lang.String filename)` Sends RETR command to the FTP server and receive the response.
    `FTPReply` | `executeLsCmd(java.lang.String pathname)` Sends NLST command to the FTP server and receive the list of files available for that current `pathname`
    `FTPReply[]` | `executeMdelCmd(java.lang.String pathname)` Sends NLST command to retrieve the files that needs to be deleted based on the `pathname` specified.
    `FTPReply[]` | `executeMgetCmd(java.lang.String filename)` Retrieves the list of files that match the `filename` value.
    `FTPReply` | `executeMkdirCmd(java.lang.String pathname)` Sends MKD command to the FTP server to create a directory specified in `pathname` at the current working directory.
    `FTPReply[]` | `executeMputCmd(java.lang.String filename)` Stores the list of files that match the `filename` value.
    `FTPReply` | `executePutCmd(java.lang.Object data, boolean isreference, java.lang.String remotefilename)` Sends STOR command to the FTP server to store the contents of the file under the name specified in `remotefilename`.
    `FTPReply` | `executePutCmd(java.lang.String filename)` Sends STOR command to the FTP server to store the contents of the file under the name specified in `filename`.
    `FTPReply` | `executePutCmd(java.lang.String filename, java.lang.String remotefilename)` Sends STOR command to the FTP server to store the contents of the file under the name specified in `remotefilename`.
    `FTPReply` | `executePwdCmd()` Sends PWD command to the FTP server and Prints the Working Directory
    `FTPReply` | `executeQuoteCmd(java.lang.String command, java.lang.String arg)` Sends any `command` that is defined in the RFC 959 specification.
    `FTPReply[]` | `executeRenameCmd(java.lang.String oldfilename, java.lang.String newfilename)` Sends RNFR and RNTO to rename the `oldfilename to `newfilename`.`
    `FTPReply` | `executeRmdirCmd(java.lang.String pathname)` Sends RMD command to the FTP server to remove the directory specified in `pathname`.
    `FTPReply` | `executeSiteCmd(java.lang.String command)` Sends SITE command to the FTP server to retrieve services specific to his system that are essential to file transfer but not sufficiently universal to be included as a regular command.
    `FTPReply` | `executeStatusCmd(java.lang.String pathname)` Sends STAT command to the FTP server to get the status response of the `pathname` specified as a parameter.
    `FTPReply` | `executeStouCmd()` Sends STOU command to the FTP server to store the contents of the file under the name that is generated by the FTP server.
    `FTPReply` | `executeTypeCmd(java.lang.String typeCode)` Sends TYPE command to the FTP server.
    `IClientObject` | `getClientObject()` Retrieve a client object, which can provide more context specific information about the transaction.
    `int` | `getFTPMode()` Gets the FTP mode that is set.
    `java.lang.String` | `getHost()` Gets the hostname of the FTP server.
    `java.lang.String` | `getName()`
    `java.lang.String` | `getPassword()` Gets the password that is used to connect to the FTP server.
    `int` | `getPort()` Gets the port number that is used to connect to the FTP server.
    `java.lang.String` | `getTransportType()` Only when secure transport is used.
    `java.lang.String` | `getUsername()` Gets the username that is used to connect to the FTP server.
    `boolean` | `isBinaryTransfer()` Get the transfer mode.
    `boolean` | `isSecureMode()` Checks if the FTP connection is secure or unsecure.
    `void` | `setBinaryTransfer(boolean binary)` Set the transfer mode.
    `void` | `setControlConnectionTimeout(int seconds)` Enable/disable the SO_TIMEOUT with the specified timeout, in seconds.
    `void` | `setDataConnectionTimeout(int seconds)` Enable/disable the SO_TIMEOUT with the specified timeout, in seconds for the data connection.
    `void` | `setFTPMode(int mode)` Sets the FTP mode to be either Active or Passive for the data connection.
    `void` | `setSecureMode(boolean bSecureMode)` Deprecated. The FTP transport configuration provides a way to set the secure mode and associate a certificate for SSL.
    `void` | `setSSLCertificate(java.lang.String certificateName)` Set the SSL certificate name to do SSL handshake.
    `void` | `setSSLHostKey(java.lang.String hostKeyName)` Set the host private key to be used for SSL handshake that requires client authentication.
    `void` | `setTransportType(java.lang.String type)` Only when secure transport is used.
    `boolean` | `useHttpProxyServer()` Checks if an HTTP proxy server is used to connect to the FTP server.
    `boolean` | `useProxyServer()` Checks if a proxy server is used to connect to the FTP server.

- - ### Field Detail

    - #### FTP_STATUS_OK

          static final int FTP_STATUS_OK

      Generic successful completion.
      See Also:
        Constant Field Values

    - #### FTP_STATUS_ERROR

          static final int FTP_STATUS_ERROR

      Generic failure, possibly due to unknown reasons.
      See Also:
        Constant Field Values

    - #### FTP_OBJ

          static final java.lang.String FTP_OBJ

      The name of the slot, which returns the ftp client itself. This means that the script variable 'job' is essentially identical to job.get(Packages.com.tibco.ax.fw.runtime.transport.ftp.FTP_OBJ).
      See Also:
        Constant Field Values

    - #### OBPGP_HANDLER

          static final java.lang.String OBPGP_HANDLER

      The Outbound PGPHandler name
      See Also:
        Constant Field Values

    - #### IBPGP_HANDLER

          static final java.lang.String IBPGP_HANDLER

      The Inbound PGPHandler name
      See Also:
        Constant Field Values

    - #### TPNAME

          static final java.lang.String TPNAME

      The partner name
      See Also:
        Constant Field Values

    - #### HOSTNAME

          static final java.lang.String HOSTNAME

      The host name
      See Also:
        Constant Field Values

    - #### LOG_OBJ

          static final java.lang.String LOG_OBJ

      The log client extension handle for custom scripts to log.
      See Also:
        Constant Field Values

    - #### SRC_FILE_NAME

          static final java.lang.String SRC_FILE_NAME

      The file name used specifically for outbound referenced payload.
      See Also:
        Constant Field Values

    - #### OUTPUT_SOURCE_DIR

          static final java.lang.String OUTPUT_SOURCE_DIR

      For FTP Put this is the path where the referenced file is taken from.
      See Also:
        Constant Field Values

    - #### ORIG_FILE_NAME

          static final java.lang.String ORIG_FILE_NAME

      Optional, it can be used by business protocols to indicate the original file name location of a file reference. Consult with the protocol documentation for more details.
      See Also:
        Constant Field Values

    - #### ORIG_FILE_PATH

          static final java.lang.String ORIG_FILE_PATH

      Optional, it can be used by business protocols to indicate the original path of a file reference. Consult with the protocol documentation for more details.
      See Also:
        Constant Field Values

    - #### TRANSACTION_ID

          static final java.lang.String TRANSACTION_ID

      The transaction ID of the message. E.g. Tid0001
      See Also:
        Constant Field Values

    - #### DOCUMENT_ID

          static final java.lang.String DOCUMENT_ID

      The document ID of the message. E.g. did0001
      See Also:
        Constant Field Values

    - #### OPERATION_ID

          static final java.lang.String OPERATION_ID

      The operation ID of the message. E.g. BC/1.0/Notify
      See Also:
        Constant Field Values

    - #### DATA_OBJ

          static final java.lang.String DATA_OBJ

      If the payload exists in memory and therefore it is not referenced by a filename, this slot holds the object, which can be retrieved through the method get("dataObj").
      See Also:
        Constant Field Values

    - #### INPUT_SOURCE_DIR

          static final java.lang.String INPUT_SOURCE_DIR

      For FTP Get this is the path where the fetched files are to be stored
      See Also:
        Constant Field Values

    - #### RETRY_SLOT

          static final java.lang.String RETRY_SLOT

      The value "true" or "false" depending on whether the custom script wants BusinessConnect to re-execute itself. The script can only ask for re-execution at most as many times as the transport's "Retry Count" property has been configured to.
      See Also:
        Constant Field Values

    - #### USER_STATUS_CODE

          static final java.lang.String USER_STATUS_CODE

      The custom script can return a status code in this slot. This value is used by the framework to determine the outcome of the custom script. If this slot is not populated or populated with a value such that 200 <= code < 300, the framework assumes a successful execution, else an error will be assumed and the corresponding advisory will be generated.
      See Also:
        Constant Field Values

    - #### USER_STATUS_MSG

          static final java.lang.String USER_STATUS_MSG

      The custom script can return a status message in this slot.
      See Also:
        Constant Field Values

    - #### ALL_FILE_LIST

          static final java.lang.String ALL_FILE_LIST

      Optional, it can be used by business protocols during post processing messages. Consult with the protocol documentation for more details.
      See Also:
        Constant Field Values

    - #### COMMON_ALL_FILE_LIST

          static final java.lang.String COMMON_ALL_FILE_LIST

      Optional, it can be used by business protocols during post processing messages. Consult with the protocol documentation for more details.
      See Also:
        Constant Field Values

    - #### DELETE_FILE

          static final java.lang.String DELETE_FILE

      Currently not used.
      See Also:
        Constant Field Values

    - #### ACTIVE_MODE

          static final int ACTIVE_MODE

      FTP active mode to be set so that FTP client can listen on a port and send the ip and port information through the use of PORT FTP command
      See Also:
        Constant Field Values

    - #### PASSIVE_MODE

          static final int PASSIVE_MODE

      FTP passive mode to be set so that FTP server can listen on a port and send the ip and port information to the FTP client when the client issues PASV command. This is the default that will be set.

      Please notice that if the FTP server does not support passive mode, then the FTP command PASV will result in a `502` code from the FTP server.

      See Also:
        Constant Field Values

    - #### DEFAULT_FTP_PORT

          static final int DEFAULT_FTP_PORT

      See Also:
        Constant Field Values

  - ### Method Detail

    - #### getUsername

          java.lang.String getUsername()

      Gets the username that is used to connect to the FTP server.

      This method can be called when FTP connections go through the HTTP proxy server.

      Returns:
        the username entered in configuration.

    - #### getPassword

          java.lang.String getPassword()

      Gets the password that is used to connect to the FTP server. This password is the clear text after decoding is done.

      This method can be called when FTP connections go through the HTTP proxy server.

      Returns:
        the clear text password entered in configuration.

    - #### getHost

          java.lang.String getHost()

      Gets the hostname of the FTP server.

      This method can be called when FTP connections go through the HTTP proxy server.

      Returns:
        the hostname entered in configuration.

    - #### getPort

          int getPort()

      Gets the port number that is used to connect to the FTP server.

      This method can be called when FTP connections go through the HTTP proxy server.

      Returns:
        the port number entered in configuration.

    - #### connect

          FTPReply connect()

      Connects to the FTP server using the user, password, and port specified in the configuration for non-proxy connections.

      This method can be called when FTP connections go through the HTTP proxy server.

      After creating to the socket, internally it would send USER and then PASS to complete the connection. It also sends PASV command to verify if the FTP server has PASV implemented. If PASV is not implemented by the FTP server, it will create a ServerSocket and listen on a port for receiving data.

      For proxy server connection, it just creates a socket connection and waits for the command to be executed.

      Note: Possible FTP codes returned by USER command

      `230`, `200`

      `530`

      `500`, `501`, `421`

      `331`, `332`

      `530`, `550`

      Note: Possible FTP codes returned by PASS command

      `230`

      `202`

      `530`

      `500`, `501`, `503`, `421`

      `332`

      Note: Possible FTP codes returned by PASV command

      `227`

      `500`, `501`, `502`, `421`, `530`

      Returns:
        the Reply from the last command that was executed successfully. If connection failed or the hostname cannot be connected, a 699 will be returned.

    - #### disconnect

          void disconnect()

      Disconnects from the FTP server by sending the QUIT command for non proxy connections.

      This method can be called when FTP connections go through the HTTP proxy server.

    - #### setFTPMode

          void setFTPMode(int mode)

      Sets the FTP mode to be either Active or Passive for the data connection. Either set `ACTIVE_MODE` or `PASSIVE_MODE` as the argument.

      This method is valid only for FTP connections over non-proxy mode.

      Parameters:
        `mode` - is either `ACTIVE_MODE` or `PASSIVE_MODE`

    - #### getFTPMode

          int getFTPMode()

      Gets the FTP mode that is set. Either gets `ACTIVE_MODE` or `PASSIVE_MODE`.
      Returns:
        either `ACTIVE_MODE` or `PASSIVE_MODE`

        This method is valid only for FTP connections over non-proxy mode.

    - #### setSecureMode

          void setSecureMode(boolean bSecureMode)
                             throws java.lang.Exception

      Deprecated. The FTP transport configuration provides a way to set the secure mode and associate a certificate for SSL.
      Set the mode to either be secure or unsecure. A value of true would set the FTP connection ( Control and Data Channel) to be secure. A value of false would make the connection unsecure. This method must be called before calling `connect()` method. Secure mode is achieved by opening a SSL connection using AUTH SSL FTP command (specified in RFC 2228) sent to the FTP server. FTP server must support SSL (AUTH command as well) for secure mode.

      Note: FTP over SSL cannot be used over proxy server at this time. This method should not be called if the FTP connections go over a proxy server.

      Parameters:
        `bSecureMode` - is the flag to set secure/unsecure mode. A value of true will set the FTP connection to be secure.
      Throws:
        `java.lang.Exception` - If an FTP connection is already open with the FTP server.

    - #### isSecureMode

          boolean isSecureMode()

      Checks if the FTP connection is secure or unsecure. A value of true indicates that the FTP connection is secure and a value of false, indicates an unsecure connection.
      Returns:
        either true or false depending on whether the FTP connection is secure or unsecure.

    - #### setSSLCertificate

          void setSSLCertificate(java.lang.String certificateName)
                                 throws java.lang.Exception

      Set the SSL certificate name to do SSL handshake. This method must be called before calling `connect()` method to be effective. Secure mode is achieved by opening a SSL connection using AUTH SSL with the `certificateName` provided as a parameter. FTP server must support SSL (AUTH command as well) for secure mode.

      Note: FTP over SSL cannot be used over a proxy server. This method should not be called if the FTP connections go over a proxy server.

      Parameters:
        `certificateName` - is the name of the certificate specified in the trading partner Credentials tab.
      Throws:
        `java.lang.Exception` - if `certificateName` is null or if a valid certificate name cannot be obtained from the store. Exception is also thrown if you try to set the certificate when an FTP connection is already open with the FTP server.

    - #### setSSLHostKey

          void setSSLHostKey(java.lang.String hostKeyName)
                             throws java.lang.Exception

      Set the host private key to be used for SSL handshake that requires client authentication. for secure FTP connection. This method must be called before calling `connect()` method to be effective. Secure mode is achieved by opening a SSL connection using AUTH SSL FTP command (specified in RFC 2228) sent to the FTP server. FTP server must support SSL (AUTH command as well) for secure mode.

      Note: FTP over SSL cannot be used with a proxy server. This method should not be called if the FTP connections go over a proxy server.

      Parameters:
        `hostKeyName` - is the name of the host private key to be used for SSL handshake that requires client authentication.
      Throws:
        `java.lang.Exception` - if `hostKeyName` is null or if the key could not be located in the key store. Exception is also thrown if you try to set the host key when an FTP connection is already open with the FTP server.

    - #### setControlConnectionTimeout

          void setControlConnectionTimeout(int seconds)

      Enable/disable the SO_TIMEOUT with the specified timeout, in seconds. With this option set to a non-zero timeout, a call to java.io.InputStream will block for `seconds` after which an java.io.InterruptedIOException will be thrown by the Socket.
      Parameters:
        `seconds` - is the non-zero timeout value specified in units of seconds.

        This method is valid only for FTP connections over non-proxy mode. For FTP connections involving HTTP proxy server, the value set on this method will be ignored.

    - #### setDataConnectionTimeout

          void setDataConnectionTimeout(int seconds)

      Enable/disable the SO_TIMEOUT with the specified timeout, in seconds for the data connection.
      Parameters:
        `seconds` - is the non-zero timeout value specified in units of seconds.

    - #### useProxyServer

          boolean useProxyServer()

      Checks if a proxy server is used to connect to the FTP server.

      This method can be called when FTP connections go through the HTTP proxy server.

      Returns:
        true if proxy Server is used to connect, false if a proxy server is not used to connect to the FTP server.

    - #### useHttpProxyServer

          boolean useHttpProxyServer()

      Checks if an HTTP proxy server is used to connect to the FTP server.

      This method can be called when FTP connections go through the HTTP proxy server.

      Returns:
        true if an HTTP proxy Server is used to connect, false if a proxy server is not used to connect to the FTP server or the proxy server is of type SOCKS4/5

    - #### executeCdCmd

          FTPReply executeCdCmd(java.lang.String pathname)
                                throws java.lang.Exception

      Sends CWD command to the FTP server and returns the reply.

      Note: Possible FTP codes returned by this command

      `250`

      `426`

      `500`, `501`, `502`, `421`, `530`, `550`

      Parameters:
        `pathname` - is the directory to change
      Returns:
        the FTPReply object that contains the FTP code and message from the FTP server.
      Throws:
        `java.lang.Exception` - if `connect()` is not called before calling this method or if this method is called when FTP connections go through HTTP proxy server. Exception is also thrown if this method is called when `connect()` method is not successful. So users must always check the reply of connect method.

    - #### executeLsCmd

          FTPReply executeLsCmd(java.lang.String pathname)
                                throws java.lang.Exception

      Sends NLST command to the FTP server and receive the list of files available for that current `pathname`

      Note: Possible FTP codes returned by this command

      `125`, `150`

      `226`, `250` `425`, `426`, `451`

      `450`

      `500`, `501`, `502`, `421`, `530`

      Parameters:
        `pathname` - is the directory to list files
      Returns:
        the FTPReply object that contains the FTP code and message from the FTP server.
      Throws:
        `java.lang.Exception` - if `connect()` is not called before calling this method or if this method is called when FTP connections go through HTTP proxy server. Exception is also thrown if this method is called when `connect()` method is not successful. So users must always check the reply of connect method.

    - #### executeDirCmd

          FTPReply executeDirCmd(java.lang.String pathname)
                                 throws java.lang.Exception

      Sends LIST command to the FTP server and receives the list of directory listing for that current pathname.

      Note: Possible FTP codes returned by this command

      `125`, `150`

      `226`, `250` `425`, `426`, `451`

      `450`

      `500`, `501`, `502`, `421`, `530`

      Parameters:
        `pathname` - is the directory you want to list files
      Returns:
        the FTPReply object that contains the FTP code and message from the FTP server.
      Throws:
        `java.lang.Exception` - if `connect()` is not called before calling this method or if this method is called when FTP connections go through HTTP proxy server. Exception is also thrown if this method is called when `connect()` method is not successful. So users must always check the reply of connect method.

    - #### executePwdCmd

          FTPReply executePwdCmd()
                                 throws java.lang.Exception

      Sends PWD command to the FTP server and Prints the Working Directory

      Note: Possible FTP codes returned by this command

      `257`

      `500`, `501`, `502`, `421`, `550`

      Returns:
        the FTPReply object that contains the FTP code and message from the FTP server.
      Throws:
        `java.lang.Exception` - if `connect()` is not called before calling this method or if this method is called when FTP connections go through HTTP proxy server. Exception is also thrown if this method is called when `connect()` method is not successful. So users must always check the reply of connect method.

    - #### executeTypeCmd

          FTPReply executeTypeCmd(java.lang.String typeCode)
                                  throws java.lang.Exception

      Sends TYPE command to the FTP server. Any of the following values can be sent to the FTP server if the FTP server has the data representation implemented: They are A (for ascii), I( binary), E ( EBCDIC) and L (for Local byte Byte Size).

      This method can be called when FTP connections go through the HTTP proxy server.

      Parameters:
        `typeCode` - is the data representation to be followed for file transfer until the `typeCode` is modified. Default representation is A.

        Typecode support is purely based on the implementation of the FTP server.

        Note: Possible FTP codes returned by this command

        `200`

        `500`, `501`, `504`, `421`, `530`

      Returns:
        the FTPReply object that contains the FTP code and message from the FTP server.
      Throws:
        `java.lang.Exception` - when `connect()` is not called before calling this method. Exception is also thrown if this method is called when `connect()` method is not successful. So users must always check the reply of connect method.

    - #### executeGetCmd

          FTPReply executeGetCmd(java.lang.String filename)
                                 throws java.lang.Exception

      Sends RETR command to the FTP server and receive the response. The file is stored locally as specified in the configuration file.

      This method can be called when FTP connections go through the HTTP proxy server.

      Note: Possible FTP codes returned by this command

      `125`, `150`

      `226`, `250`

      `425`, `426`, `451`

      `450`, `550`

      `500`, `501`, `421`, `530`

      Parameters:
        `filename` - to be retrieved from the FTP server. This parameter can only be a filename and should not include any directory path. If you want to retrieve a file from a particular directory, call `executeCdCmd(java.lang.String)` first to that directory. File that is retrieved will be stored locally to a directory that is specified by the configuration property. See documentation for more details on the location of the storage.
      Returns:
        the reply object which contains the FTP code and FTP message text
      Throws:
        `java.lang.Exception` - if `connect()` is not called before calling this method Exception is also thrown if this method is called when `connect()` method is not successful. So users must always check the reply of connect method.

    - #### executeMgetCmd

          FTPReply[] executeMgetCmd(java.lang.String filename)
                                    throws java.lang.Exception

      Retrieves the list of files that match the `filename` value. NLST is sent to the FTP server for the `filename` specified. If there are files found that match the `filename`, then either PASV or PORT command is sent depending on if the FTP Client is setup to either initiate or 'listen' the connection for each file to be retrieved. A RETR command is sent for each file to retrieve the file to the local fileSystem.

      Note: Possible FTP codes returned by this command includes codes from `executeLsCmd(java.lang.String)` and `executeGetCmd(java.lang.String)`

      Parameters:
        `filename` - is sent which can contain a wildcard '*' to get all files that have the pattern described in `filename`. This parameter can only be a filename with/without wildcard and should not include any directory path. If you want to retrieve a file from a particular directory, call `executeCdCmd(java.lang.String)` first to that directory. Files that are retrieved will be stored locally to a directory that is specified by the configuration property. See documentation for more details on the location of the storage.
      Returns:
        a list of FTPReply objects depending on the number of files retrieved. If there are no files that match the `filename` pattern, only NLST command reply object is sent back.
      Throws:
        `java.lang.Exception` - if `connect()` is not called before calling this method or if this method is called when FTP connections go through HTTP proxy server. Exception is also thrown if this method is called when `connect()` method is not successful. So users must always check the reply of connect method.

    - #### executePutCmd

          FTPReply executePutCmd(java.lang.String filename)
                                 throws java.lang.Exception

      Sends STOR command to the FTP server to store the contents of the file under the name specified in `filename`. The `filename` is the actual filename in the file system passed from the Job Slot.

      This method can be called when FTP connections go through the HTTP proxy server.

      Note: Possible FTP codes returned by this command

      `125`, `150`

      `226`, `250`

      `425`, `426`, `451`, `551`, `552`

      `532`, `450`, `452`, `553`

      `500`, `501`, `421`, `530`

      To store a filename specified by the user, you would want to use `executePutCmd(String, String)` call.

      Parameters:
        `filename` - that is passed from the Job slot which represends the actual filename in the filesystem. This parameter can only be a filename and should not include any directory path. If you want to store a file to a particular directory in the FTP server, call `executeCdCmd(java.lang.String)` first to that directory. File that is about to be stored will be read from local directory that is specified by the configuration. See documentation for more details on the location of the storage.
      Returns:
        the reply object which contains the FTP code and FTP message text
      Throws:
        `java.lang.Exception` - if `connect()` is not called before calling this method Exception is also thrown if this method is called when `connect()` method is not successful. So users must always check the reply of connect method.

    - #### executePutCmd

          FTPReply executePutCmd(java.lang.String filename,
                               java.lang.String remotefilename)
                                 throws java.lang.Exception

      Sends STOR command to the FTP server to store the contents of the file under the name specified in `remotefilename`.

      This method can be called when FTP connections go through the HTTP proxy server.

      Note: Possible FTP codes returned by this command

      `125`, `150`

      `226`, `250`

      `425`, `426`, `451`, `551`, `552`

      `532`, `450`, `452`, `553`

      `500`, `501`, `421`, `530`

      Parameters:
        `filename` - that is passed from the Job slot which represends the actual filename in the filesystem.
        `remotefilename` - to be stored to the FTP server. This parameter can only be a filename and should not include any directory path. If you want to store a file to a particular directory in the FTP server, call `executeCdCmd(java.lang.String)` first to that directory. File that is about to be stored will be read from local directory that is specified by the configuration property. See documentation for more details on the location of the storage.
      Returns:
        the reply object which contains the FTP code and FTP message text
      Throws:
        `java.lang.Exception` - if `connect()` is not called before calling this method Exception is also thrown if this method is called when `connect()` method is not successful. So users must always check the reply of connect method.

    - #### executePutCmd

          FTPReply executePutCmd(java.lang.Object data,
                               boolean isreference,
                               java.lang.String remotefilename)
                                 throws java.lang.Exception

      Sends STOR command to the FTP server to store the contents of the file under the name specified in `remotefilename`.

      This method can be called when FTP connections go through the HTTP proxy server.

      Note: Possible FTP codes returned by this command

      `125`, `150`

      `226`, `250`

      `425`, `426`, `451`, `551`, `552`

      `532`, `450`, `452`, `553`

      `500`, `501`, `421`, `530`

      Parameters:
        `data` - that is passed from the Job slot which represents the actual in memory object.
        `isreference` - if an in memory object is passed in, it must be false, otherwise true. If a reference is used then `executePutCmd(String)` or `executePutCmd(String, String)` can be used instead.
        `remotefilename` - to be stored to the FTP server. This parameter can only be a filename and should not include any directory path. If you want to store a file to a particular directory in the FTP server, call `executeCdCmd(java.lang.String)` first to that directory. File that is about to be stored will be read from local directory that is specified by the configuration property. See documentation for more details on the location of the storage.
      Returns:
        the reply object which contains the FTP code and FTP message text
      Throws:
        `java.lang.Exception` - if `connect()` is not called before calling this method Exception is also thrown if this method is called when `connect()` method is not successful. So users must always check the reply of connect method.

    - #### executeMputCmd

          FTPReply[] executeMputCmd(java.lang.String filename)
                                    throws java.lang.Exception

      Stores the list of files that match the `filename` value. Either PASV or PORT command is sent depending on if the FTP Client is setup to either initiate or 'listen' the connection for each file to be stored. A STOR command is sent for each file to be stored on the FTP server from the local fileSystem.

      Note: Possible FTP codes returned by this command includes code from `executePutCmd(java.lang.String)`

      Parameters:
        `filename` - is sent which can contain a wildcard '*' to get all files that have the pattern described in `filename`. This parameter can only be a filename with/without wildcard and should not include any directory path. If you want to store a file to a particular directory in the FTP server, call `executeCdCmd(java.lang.String)` first to that directory. File that is about to be stored will be read from local directory that is specified by the configuration property. See documentation for more details on the location of the storage.
      Returns:
        a list of FTPReply objects depending on the number of files stored. If there are no files that match the `filename` pattern, only
      Throws:
        `java.lang.Exception` - if `connect()` is not called before calling this method or if this method is called when FTP connections go through HTTP proxy server. Exception is also thrown if this method is called when `connect()` method is not successful. So users must always check the reply of connect method.

    - #### executeStouCmd

          FTPReply executeStouCmd()
                                  throws java.lang.Exception

      Sends STOU command to the FTP server to store the contents of the file under the name that is generated by the FTP server.

      Note: Possible FTP codes returned by this command

      `125`, `150`

      `226`, `250`

      `425`, `426`, `451`, `551`, `552`

      `532`, `450`, `452`, `553`

      `500`, `501`, `421`, `530`

      Returns:
        the reply object which contains the FTP code and FTP message text
      Throws:
        `java.lang.Exception` - if `connect()` is not called before calling this method or if this method is called when FTP connections go through HTTP proxy server. Exception is also thrown if this method is called when `connect()` method is not successful. So users must always check the reply of connect method.

    - #### executeAppendCmd

          FTPReply executeAppendCmd(java.lang.String filename)
                                    throws java.lang.Exception

      Sends APPE command to the FTP server to store the contents of the file under the name `filename` on the FTP server. If a file exists in the FTP server with the same `filename`, the contents are appended to that file. If a file does not exist, a new file is created and saved under the name specified in `filename`.

      Note: Possible FTP codes returned by this command

      `125`, `150`

      `226`, `250`

      `425`, `426`, `451`, `551`, `552`

      `532`, `450`, `452`, `553`

      `500`, `501`, `421`, `530`

      Parameters:
        `filename` - is the name of the file that should be stored on the FTP server.
      Returns:
        the reply object which contains the FTP code and FTP message text
      Throws:
        `java.lang.Exception` - if `connect()` is not called before calling this method or if this method is called when FTP connections go through HTTP proxy server. Exception is also thrown if this method is called when `connect()` method is not successful. So users must always check the reply of connect method.

    - #### executeRenameCmd

          FTPReply[] executeRenameCmd(java.lang.String oldfilename,
                                    java.lang.String newfilename)
                                      throws java.lang.Exception

      Sends RNFR and RNTO to rename the `oldfilename to `newfilename`. If the RNFR fails because `oldfilename` does not exist, then RNTO command is not issued to the FTP server.

      Note: Possible FTP codes returned by RNFR command

      `450`, `550`,

      `500`, `501`, `502`, `421`, `530`

      `350`

      Note: Possible FTP codes returned by RNTO command

      `250`

      `532`, `553`

      `500`, `501`, `502`, `503`, `421`, `530`

      `350`

      `
      Parameters:
        `oldfilename` - is the old filename that exists in the FTP server.
        `newfilename` - is the new filename that you would to rename to.
      Returns:
        If the RNFR succeeds, then a list of 2 FTPReply objects are returned with the FTP code for RNFR and RNTO If RNFR fails, then the list will contain only one FTPReply object.
      Throws:
        `java.lang.Exception` - if `connect()` is not called before calling this method or if this method is called when FTP connections go through HTTP proxy server. Exception is also thrown if this method is called when `connect()` method is not successful. So users must always check the reply of connect method.

    - #### executeDelCmd

          FTPReply executeDelCmd(java.lang.String filename)
                                 throws java.lang.Exception

      Sends DELE command to the FTP server to delete the filename specified in `filename` parameter.

      Note: Possible FTP codes returned by this command

      `250`

      `450`, `550`

      `500`, `501`, `502`, `421`, `530`

      Parameters:
        `filename` - is the name of the file to be deleted in the FTP server.
      Returns:
        the reply from the FTP server about the status of the command.
      Throws:
        `java.lang.Exception` - if `connect()` is not called before calling this method or if this method is called when FTP connections go through HTTP proxy server. Exception is also thrown if this method is called when `connect()` method is not successful. So users must always check the reply of connect method. Due to the lack of standard guidance, this command cannot be used over a http proxy connection.

    - #### executeMdelCmd

          FTPReply[] executeMdelCmd(java.lang.String pathname)
                                    throws java.lang.Exception

      Sends NLST command to retrieve the files that needs to be deleted based on the `pathname` specified. If there are files returned from NLST command, then DELE command is sent for each of those files to be deleted at the FTP server.

      Note: Possible FTP codes returned by this command includes codes from `executeDelCmd(java.lang.String)` and `executeLsCmd(java.lang.String)`

      Parameters:
        `pathname` - is the partial pathname to be deleted in the FTP server.
      Returns:
        the reply from the FTP server about the status of the command.
      Throws:
        `java.lang.Exception` - if `connect()` is not called before calling this method or if this method is called when FTP connections go through HTTP proxy server. Exception is also thrown if this method is called when `connect()` method is not successful. So users must always check the reply of connect method.

    - #### executeMkdirCmd

          FTPReply executeMkdirCmd(java.lang.String pathname)
                                   throws java.lang.Exception

      Sends MKD command to the FTP server to create a directory specified in `pathname` at the current working directory.

      Note: Possible FTP codes returned by this command

      `257`

      `500`, `501`, `502`, `421`, `530`, `550`

      Parameters:
        `pathname` - is the name of the directory in the FTP server.
      Returns:
        the reply from the FTP server about the status of the command.
      Throws:
        `java.lang.Exception` - if `connect()` is not called before calling this method or if this method is called when FTP connections go through HTTP proxy server. Exception is also thrown if this method is called when `connect()` method is not successful. So users must always check the reply of connect method.

    - #### executeRmdirCmd

          FTPReply executeRmdirCmd(java.lang.String pathname)
                                   throws java.lang.Exception

      Sends RMD command to the FTP server to remove the directory specified in `pathname`.

      Note: Possible FTP codes returned by this command

      `250`

      `500`, `501`, `502`, `421`, `530`, `550`

      Parameters:
        `pathname` - is the name of the directory to be in the FTP server.
      Returns:
        the reply from the FTP server about the status of the command.
      Throws:
        `java.lang.Exception` - if `connect()` is not called before calling this method or if this method is called when FTP connections go through HTTP proxy server. Exception is also thrown if this method is called when `connect()` method is not successful. So users must always check the reply of connect method.

    - #### executeSiteCmd

          FTPReply executeSiteCmd(java.lang.String command)
                                  throws java.lang.Exception

      Sends SITE command to the FTP server to retrieve services specific to his system that are essential to file transfer but not sufficiently universal to be included as a regular command.

      Note: Possible FTP codes returned by this command

      `200`

      `202`

      `500`, `501`, `530`,

      Parameters:
        `command` - is the command that is provided by the FTP server. If an empty string is sent, then a list of commands serviced for SITE command is returned in the control connection.
      Returns:
        the reply from the FTP server.
      Throws:
        `java.lang.Exception` - if `connect()` is not called before calling this method or if this method is called when FTP connections go through HTTP proxy server. Exception is also thrown if this method is called when `connect()` method is not successful. So users must always check the reply of connect method.

    - #### executeStatusCmd

          FTPReply executeStatusCmd(java.lang.String pathname)
                                    throws java.lang.Exception

      Sends STAT command to the FTP server to get the status response of the `pathname` specified as a parameter. If you send in a empty value, the server should return general status information about the server FTP process.

      By providing a pathname, the command is analogous to the `executeDirCmd(java.lang.String)` except that data shall be transferred over the control connection. If a partial pathname is given, the server may respond with a list of file names or attributes associated with that specification.

      Note: Possible FTP codes returned by this command

      `211`, `212`, `213`

      `450`

      `500`, `501`, `502`, `421`, `530`,

      Parameters:
        `pathname` - is either to return a list of files for a qualified name,
      Returns:
        the reply from the FTP server about the status of the command and the FTP message text.
      Throws:
        `java.lang.Exception` - if `connect()` is not called before calling this method or if this method is called when FTP connections go through HTTP proxy server. Exception is also thrown if this method is called when `connect()` method is not successful. So users must always check the reply of connect method.

    - #### executeQuoteCmd

          FTPReply executeQuoteCmd(java.lang.String command,
                                 java.lang.String arg)
                                   throws java.lang.Exception

      Sends any `command` that is defined in the RFC 959 specification. `arg` value should be sent for the `command`. Note: Possible FTP codes returned by this command depends on the command that is executed.
      Parameters:
        `command` - is the name of the command to be executed on the FTP server.
        `arg` - is the argument for `command`
      Returns:
        the reply from the FTP server about the status of the command.
      Throws:
        `java.lang.Exception` - if `connect()` is not called before calling this method or if this method is called when FTP connections go through HTTP proxy server. Exception is also thrown if this method is called when `connect()` method is not successful. So users must always check the reply of connect method.

    - #### setBinaryTransfer

          void setBinaryTransfer(boolean binary)

      Set the transfer mode.
      Parameters:
        `binary` - True if binary, false otherwise.

    - #### isBinaryTransfer

          boolean isBinaryTransfer()

      Get the transfer mode.
      Returns:
        True, if binary, false otherwise.

    - #### aeTrace

          void aeTrace(java.lang.String role,
                     java.lang.String msgcode,
                     java.lang.String desc,
                     java.lang.String trackingInfo)

    - #### getName

          java.lang.String getName()

    - #### setTransportType

          void setTransportType(java.lang.String type)

      Only when secure transport is used. Set the secured transport type to either SSL or TLS
      Parameters:
        `type` - The value of "SSL" or "TLS".

    - #### getTransportType

          java.lang.String getTransportType()

      Only when secure transport is used. Returns the type as either "SSL" or "TLS"
      Returns:
        The type of the secure transport.

    - #### getClientObject

          IClientObject getClientObject()

      Retrieve a client object, which can provide more context specific information about the transaction.
      Returns:
        The client object `IClientObject`.