Class FTPSConnection

  • All Implemented Interfaces:
    EventListener, org.ftp4che.event.FTPListener

    public class FTPSConnection
    extends Object
    implements org.ftp4che.event.FTPListener
    • Field Detail

      • CONNECTION_TYPE_FTP_IMPLICIT_SSL

        public static final int CONNECTION_TYPE_FTP_IMPLICIT_SSL
        See Also:
        Constant Field Values
      • CONNECTION_TYPE_FTP_AUTH_SSL

        public static final int CONNECTION_TYPE_FTP_AUTH_SSL
        See Also:
        Constant Field Values
      • CONNECTION_TYPE_FTP_IMPLICIT_SSL_WITH_CRYPTED

        public static final int CONNECTION_TYPE_FTP_IMPLICIT_SSL_WITH_CRYPTED
        See Also:
        Constant Field Values
      • CONNECTION_TYPE_FTP_AUTH_TLS

        public static final int CONNECTION_TYPE_FTP_AUTH_TLS
        See Also:
        Constant Field Values
      • CONNECTION_TYPE_FTP_IMPLICIT_TLS

        public static final int CONNECTION_TYPE_FTP_IMPLICIT_TLS
        See Also:
        Constant Field Values
      • CONNECTION_TYPE_FTP_IMPLICIT_TLS_WITH_CRYPTED

        public static final int CONNECTION_TYPE_FTP_IMPLICIT_TLS_WITH_CRYPTED
        See Also:
        Constant Field Values
      • connection_type_Desc

        public static final String[] connection_type_Desc
      • connection_type_Code

        public static final String[] connection_type_Code
    • Constructor Detail

      • FTPSConnection

        @Deprecated
        public FTPSConnection​(int connectionType,
                              String hostname,
                              int port,
                              String username,
                              String password)
        Deprecated.
        Please supply real namespace as it is required for proper VFS operation
      • FTPSConnection

        public FTPSConnection​(int connectionType,
                              String hostname,
                              int port,
                              String username,
                              String password,
                              org.pentaho.di.core.variables.VariableSpace nameSpace)
    • Method Detail

      • setProxyHost

        public void setProxyHost​(String proxyhost)
        this method is used to set the proxy host
        Parameters:
        type - true: proxy host
      • setProxyPort

        public void setProxyPort​(int proxyport)
        this method is used to set the proxy port
        Parameters:
        type - true: proxy port
      • setProxyUser

        public void setProxyUser​(String username)
        this method is used to set the proxy username
        Parameters:
        type - true: proxy username
      • setProxyPassword

        public void setProxyPassword​(String password)
        this method is used to set the proxy password
        Parameters:
        type - true: proxy password
      • connect

        public void connect()
                     throws org.pentaho.di.core.exception.KettleException
        this method is used to connect to a remote host
        Throws:
        org.pentaho.di.core.exception.KettleException
      • getSecureDataFTPConnection

        protected org.ftp4che.FTPConnection getSecureDataFTPConnection​(org.ftp4che.FTPConnection connection,
                                                                       String password,
                                                                       int timeout)
                                                                throws org.ftp4che.exception.ConfigurationException
        Throws:
        org.ftp4che.exception.ConfigurationException
      • getConnectionTypeDesc

        public static String getConnectionTypeDesc​(String tt)
      • getConnectionTypeCode

        public static String getConnectionTypeCode​(String tt)
      • getConnectionTypeDesc

        public static String getConnectionTypeDesc​(int i)
      • getConnectionType

        public static String getConnectionType​(int i)
      • getConnectionTypeByDesc

        public static int getConnectionTypeByDesc​(String tt)
      • getConnectionTypeByCode

        public static int getConnectionTypeByCode​(String tt)
      • getConnectionTypeCode

        public static String getConnectionTypeCode​(int i)
      • setBinaryMode

        public void setBinaryMode​(boolean type)
                           throws org.pentaho.di.core.exception.KettleException
        public void setBinaryMode(boolean type) this method is used to set the transfer type to binary
        Parameters:
        type - true: Binary
        Throws:
        org.pentaho.di.core.exception.KettleException
      • setPassiveMode

        public void setPassiveMode​(boolean passivemode)
        this method is used to set the mode to passive
        Parameters:
        type - true: passive mode
      • isPassiveMode

        public boolean isPassiveMode()
        this method is used to return the passive mode
        Returns:
        TRUE if we use passive mode
      • setTimeOut

        public void setTimeOut​(int timeout)
        this method is used to set the timeout
        Parameters:
        timeout -
      • getTimeOut

        public int getTimeOut()
        this method is used to return the timeout
        Returns:
        timeout
      • getUserName

        public String getUserName()
      • getHostName

        public String getHostName()
      • setConnectionType

        public void setConnectionType​(int connectiontype)
        this method is used to set the connection type
        Parameters:
        type - true: connection type
      • getConnectionType

        public int getConnectionType()
      • connectionStatusChanged

        public void connectionStatusChanged​(org.ftp4che.event.FTPEvent arg0)
        Specified by:
        connectionStatusChanged in interface org.ftp4che.event.FTPListener
      • replyMessageArrived

        public void replyMessageArrived​(org.ftp4che.event.FTPEvent event)
        Specified by:
        replyMessageArrived in interface org.ftp4che.event.FTPListener
      • changeDirectory

        public void changeDirectory​(String directory)
                             throws org.pentaho.di.core.exception.KettleException
        this method change FTP working directory
        Parameters:
        directory - change the working directory
        Throws:
        org.pentaho.di.core.exception.KettleException
      • createDirectory

        public void createDirectory​(String directory)
                             throws org.pentaho.di.core.exception.KettleException
        this method is used to create a directory in remote host
        Parameters:
        directory - directory name on remote host
        Throws:
        org.pentaho.di.core.exception.KettleException
      • getFileList

        public List<org.ftp4che.util.ftpfile.FTPFile> getFileList​(String folder)
                                                           throws org.pentaho.di.core.exception.KettleException
        Throws:
        org.pentaho.di.core.exception.KettleException
      • downloadFile

        public void downloadFile​(org.ftp4che.util.ftpfile.FTPFile file,
                                 String localFilename)
                          throws org.pentaho.di.core.exception.KettleException
        this method is used to download a file from a remote host
        Parameters:
        file - remote file to download
        localFilename - target filename
        Throws:
        org.pentaho.di.core.exception.KettleException
      • uploadFile

        public void uploadFile​(String localFileName,
                               String shortFileName)
                        throws org.pentaho.di.core.exception.KettleException
        this method is used to upload a file to a remote host
        Parameters:
        localFileName - Local full filename
        shortFileName - Filename in remote host
        Throws:
        org.pentaho.di.core.exception.KettleException
      • getFileNames

        public String[] getFileNames()
                              throws org.pentaho.di.core.exception.KettleException
        this method is used to return filenames in working directory
        Returns:
        filenames
        Throws:
        org.pentaho.di.core.exception.KettleException
      • deleteFile

        public void deleteFile​(org.ftp4che.util.ftpfile.FTPFile file)
                        throws org.pentaho.di.core.exception.KettleException
        this method is used to delete a file in remote host
        Parameters:
        file - File on remote host to delete
        Throws:
        org.pentaho.di.core.exception.KettleException
      • deleteFile

        public void deleteFile​(String filename)
                        throws org.pentaho.di.core.exception.KettleException
        this method is used to delete a file in remote host
        Parameters:
        filename - Name of file on remote host to delete
        Throws:
        org.pentaho.di.core.exception.KettleException
      • moveToFolder

        public void moveToFolder​(org.ftp4che.util.ftpfile.FTPFile fromFile,
                                 String targetFoldername)
                          throws org.pentaho.di.core.exception.KettleException
        this method is used to move a file to remote directory
        Parameters:
        fromFile - File on remote host to move
        targetFoldername - Target remote folder
        Throws:
        org.pentaho.di.core.exception.KettleException
      • isDirectoryExists

        public boolean isDirectoryExists​(String directory)
        Checks if a directory exists
        Returns:
        true if the directory exists
      • isFileExists

        public boolean isFileExists​(String filename)
        Checks if a file exists on remote host
        Parameters:
        filename - the name of the file to check
        Returns:
        true if the file exists
      • getWorkingDirectory

        public String getWorkingDirectory()
                                   throws Exception
        Returns the working directory
        Returns:
        working directory
        Throws:
        Exception
      • disconnect

        public void disconnect()
        this method is used to disconnect the connection