Class FTPSConnection
- java.lang.Object
-
- org.pentaho.di.job.entries.ftpsget.FTPSConnection
-
- All Implemented Interfaces:
EventListener
,org.ftp4che.event.FTPListener
public class FTPSConnection extends Object implements org.ftp4che.event.FTPListener
-
-
Field Summary
Fields Modifier and Type Field Description static String
COMMAND_SUCCESSUL
static String[]
connection_type_Code
static String[]
connection_type_Desc
static int
CONNECTION_TYPE_FTP
static int
CONNECTION_TYPE_FTP_AUTH_SSL
static int
CONNECTION_TYPE_FTP_AUTH_TLS
static int
CONNECTION_TYPE_FTP_IMPLICIT_SSL
static int
CONNECTION_TYPE_FTP_IMPLICIT_SSL_WITH_CRYPTED
static int
CONNECTION_TYPE_FTP_IMPLICIT_TLS
static int
CONNECTION_TYPE_FTP_IMPLICIT_TLS_WITH_CRYPTED
static String
HOME_FOLDER
-
Constructor Summary
Constructors Constructor Description FTPSConnection(int connectionType, String hostname, int port, String username, String password)
Deprecated.FTPSConnection(int connectionType, String hostname, int port, String username, String password, org.pentaho.di.core.variables.VariableSpace nameSpace)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
changeDirectory(String directory)
this method change FTP working directoryvoid
connect()
this method is used to connect to a remote hostvoid
connectionStatusChanged(org.ftp4che.event.FTPEvent arg0)
void
createDirectory(String directory)
this method is used to create a directory in remote hostvoid
deleteFile(String filename)
this method is used to delete a file in remote hostvoid
deleteFile(org.ftp4che.util.ftpfile.FTPFile file)
this method is used to delete a file in remote hostvoid
disconnect()
this method is used to disconnect the connectionvoid
downloadFile(org.ftp4che.util.ftpfile.FTPFile file, String localFilename)
this method is used to download a file from a remote hostint
getConnectionType()
static String
getConnectionType(int i)
static int
getConnectionTypeByCode(String tt)
static int
getConnectionTypeByDesc(String tt)
static String
getConnectionTypeCode(int i)
static String
getConnectionTypeCode(String tt)
static String
getConnectionTypeDesc(int i)
static String
getConnectionTypeDesc(String tt)
List<org.ftp4che.util.ftpfile.FTPFile>
getFileList(String folder)
String[]
getFileNames()
this method is used to return filenames in working directoryString
getHostName()
ArrayList<String>
getReplies()
protected org.ftp4che.FTPConnection
getSecureDataFTPConnection(org.ftp4che.FTPConnection connection, String password, int timeout)
int
getTimeOut()
this method is used to return the timeoutString
getUserName()
String
getWorkingDirectory()
Returns the working directoryboolean
isDirectoryExists(String directory)
Checks if a directory existsboolean
isFileExists(String filename)
Checks if a file exists on remote hostboolean
isPassiveMode()
this method is used to return the passive modevoid
moveToFolder(org.ftp4che.util.ftpfile.FTPFile fromFile, String targetFoldername)
this method is used to move a file to remote directoryvoid
replyMessageArrived(org.ftp4che.event.FTPEvent event)
void
setBinaryMode(boolean type)
public void setBinaryMode(boolean type) this method is used to set the transfer type to binaryvoid
setConnectionType(int connectiontype)
this method is used to set the connection typevoid
setPassiveMode(boolean passivemode)
this method is used to set the mode to passivevoid
setProxyHost(String proxyhost)
this method is used to set the proxy hostvoid
setProxyPassword(String password)
this method is used to set the proxy passwordvoid
setProxyPort(int proxyport)
this method is used to set the proxy portvoid
setProxyUser(String username)
this method is used to set the proxy usernamevoid
setTimeOut(int timeout)
this method is used to set the timeoutvoid
uploadFile(String localFileName, String shortFileName)
this method is used to upload a file to a remote host
-
-
-
Field Detail
-
HOME_FOLDER
public static final String HOME_FOLDER
- See Also:
- Constant Field Values
-
COMMAND_SUCCESSUL
public static final String COMMAND_SUCCESSUL
- See Also:
- Constant Field Values
-
CONNECTION_TYPE_FTP
public static final int CONNECTION_TYPE_FTP
- See Also:
- Constant Field Values
-
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
-
-
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(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 interfaceorg.ftp4che.event.FTPListener
-
replyMessageArrived
public void replyMessageArrived(org.ftp4che.event.FTPEvent event)
- Specified by:
replyMessageArrived
in interfaceorg.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 downloadlocalFilename
- 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 filenameshortFileName
- 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 movetargetFoldername
- 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
-
-