Class FTPClientConnector

  • All Implemented Interfaces:
    ConnectorInterface, VersionInfoInterface

    public class FTPClientConnector
    extends Connector
    implements ConnectorInterface
    The FTP Client Connector is a transport Connector that requires a Parser to operate. The Connector reads or writes a data stream that can either be a file or a directory listing. Think of the FTP Client Connector as a remote read/write facility, not something you use to transfer files. This Connector supports FTP Passive Mode, as per RFC959. Passive Mode reverses who initiates the data connection in a file transfer. Normally the server initiates a data connection to the client (after a command from the client), whereas passive mode enables the client to initiate the data connection. This makes it easier to transfer files when the client is behind a firewall.
    • Constructor Detail

      • FTPClientConnector

        public FTPClientConnector()
        Default constructor
    • Method Detail

      • terminate

        public void terminate()
                       throws java.lang.Exception
        Closes connection to remote host.
        Specified by:
        terminate in interface ConnectorInterface
        Overrides:
        terminate in class Connector
        Throws:
        java.lang.Exception - if an error occurs.
      • initialize

        public void initialize​(java.lang.Object o)
                        throws java.lang.Exception
        Creates connection for the login to the remote host and opens the socket.
        Specified by:
        initialize in interface ConnectorInterface
        Overrides:
        initialize in class Connector
        Parameters:
        o - ignored
        Throws:
        java.lang.Exception - if an error occurs.
      • putEntry

        public void putEntry​(Entry entry)
                      throws java.lang.Exception
        Writes an entry , by calling the provided parser's writeEntry() method.
        Specified by:
        putEntry in interface ConnectorInterface
        Overrides:
        putEntry in class Connector
        Parameters:
        entry - the entry to be written.
        Throws:
        java.lang.Exception - if an error occurs.
      • reconnect

        @Deprecated
        public void reconnect()
                       throws java.lang.Exception
        Deprecated.
        Use #Connector.reconnect(Object) instead
        Description copied from class: Connector
        Reconnect to the underlying data source.

        The following code could be placed in the 'On Connection lost' hook to change the connector's ldapUrl to another server in case the connection is lost.

        Example:

         thisConnector.setParam("ldapURL", "ldap://backupserver.acme.com:389");
         
         // reconnect to backup server
         thisConnector.reconnect();
         
        Overrides:
        reconnect in class Connector
        Throws:
        java.lang.Exception - if an error occurs.
        See Also:
        Connector.initialize(Object)
      • getVersion

        public java.lang.String getVersion()
        Returns version information.
        Specified by:
        getVersion in interface VersionInfoInterface
        Returns:
        version info.