Class FTPConnection

    • Field Detail

      • m_Host

        protected String m_Host
        the FTP host.
      • m_User

        protected String m_User
        the FTP user to use.
      • m_Password

        protected BasePassword m_Password
        the FTP password to use.
      • m_UsePassiveMode

        protected boolean m_UsePassiveMode
        whether to use passive mode.
      • m_UseBinaryMode

        protected boolean m_UseBinaryMode
        whether to use binary file transfer mode.
      • m_RemoteDir

        protected String m_RemoteDir
        the directory to upload the file to.
      • m_Client

        protected org.apache.commons.net.ftp.FTPClient m_Client
        the FTP client object.
    • Constructor Detail

      • FTPConnection

        public FTPConnection()
    • Method Detail

      • setHost

        public void setHost​(String value)
        Sets the host to connect to.
        Parameters:
        value - the host name/ip
      • getHost

        public String getHost()
        Returns the host to connect to.
        Returns:
        the host name/ip
      • hostTipText

        public String hostTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setUser

        public void setUser​(String value)
        Sets the FTP user to use.
        Parameters:
        value - the user name
      • getUser

        public String getUser()
        Returns the FTP user name to use.
        Returns:
        the user name
      • userTipText

        public String userTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • passwordTipText

        public String passwordTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setUsePassiveMode

        public void setUsePassiveMode​(boolean value)
        Sets whether to use passive mode.
        Parameters:
        value - if true passive mode is used
      • getUsePassiveMode

        public boolean getUsePassiveMode()
        Returns whether passive mode is used.
        Returns:
        true if passive mode is used
      • usePassiveModeTipText

        public String usePassiveModeTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setUseBinaryMode

        public void setUseBinaryMode​(boolean value)
        Sets whether to use binary mode.
        Parameters:
        value - if true binary mode is used
      • getUseBinaryMode

        public boolean getUseBinaryMode()
        Returns whether binary mode is used.
        Returns:
        true if binary mode is used
      • useBinaryModeTipText

        public String useBinaryModeTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setRemoteDir

        public void setRemoteDir​(String value)
        Sets the remote directory.
        Parameters:
        value - the remote directory
      • getRemoteDir

        public String getRemoteDir()
        Returns the remote directory.
        Returns:
        the remote directory.
      • remoteDirTipText

        public String remoteDirTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • connect

        protected String connect()
        Starts up a FTP session.
        Returns:
        null if OK, otherwise error message
      • disconnect

        protected void disconnect()
        Disconnects the FTP session, if necessary.
      • getFTPClient

        protected org.apache.commons.net.ftp.FTPClient getFTPClient()
        Returns the FTP client object.
        Returns:
        the FTP client, null if failed to connect
      • doSend

        protected String doSend​(RemoteCommand cmd,
                                RemoteCommandProcessor processor)
        Sends the command to the specified sscripting engine.
        Parameters:
        cmd - the command to send
        processor - for formatting/parsing
        Returns:
        null if successfully sent, otherwise error message
      • protocolCommandSent

        public void protocolCommandSent​(org.apache.commons.net.ProtocolCommandEvent event)
        This method is invoked by a ProtocolCommandEvent source after sending a protocol command to a server.
        Specified by:
        protocolCommandSent in interface org.apache.commons.net.ProtocolCommandListener
        Parameters:
        event - The ProtocolCommandEvent fired.
      • protocolReplyReceived

        public void protocolReplyReceived​(org.apache.commons.net.ProtocolCommandEvent event)
        This method is invoked by a ProtocolCommandEvent source after receiving a reply from a server.
        Specified by:
        protocolReplyReceived in interface org.apache.commons.net.ProtocolCommandListener
        Parameters:
        event - The ProtocolCommandEvent fired.