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 StringCOMMAND_SUCCESSULstatic String[]connection_type_Codestatic String[]connection_type_Descstatic intCONNECTION_TYPE_FTPstatic intCONNECTION_TYPE_FTP_AUTH_SSLstatic intCONNECTION_TYPE_FTP_AUTH_TLSstatic intCONNECTION_TYPE_FTP_IMPLICIT_SSLstatic intCONNECTION_TYPE_FTP_IMPLICIT_SSL_WITH_CRYPTEDstatic intCONNECTION_TYPE_FTP_IMPLICIT_TLSstatic intCONNECTION_TYPE_FTP_IMPLICIT_TLS_WITH_CRYPTEDstatic StringHOME_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 voidchangeDirectory(String directory)this method change FTP working directoryvoidconnect()this method is used to connect to a remote hostvoidconnectionStatusChanged(org.ftp4che.event.FTPEvent arg0)voidcreateDirectory(String directory)this method is used to create a directory in remote hostvoiddeleteFile(String filename)this method is used to delete a file in remote hostvoiddeleteFile(org.ftp4che.util.ftpfile.FTPFile file)this method is used to delete a file in remote hostvoiddisconnect()this method is used to disconnect the connectionvoiddownloadFile(org.ftp4che.util.ftpfile.FTPFile file, String localFilename)this method is used to download a file from a remote hostintgetConnectionType()static StringgetConnectionType(int i)static intgetConnectionTypeByCode(String tt)static intgetConnectionTypeByDesc(String tt)static StringgetConnectionTypeCode(int i)static StringgetConnectionTypeCode(String tt)static StringgetConnectionTypeDesc(int i)static StringgetConnectionTypeDesc(String tt)List<org.ftp4che.util.ftpfile.FTPFile>getFileList(String folder)String[]getFileNames()this method is used to return filenames in working directoryStringgetHostName()ArrayList<String>getReplies()protected org.ftp4che.FTPConnectiongetSecureDataFTPConnection(org.ftp4che.FTPConnection connection, String password, int timeout)intgetTimeOut()this method is used to return the timeoutStringgetUserName()StringgetWorkingDirectory()Returns the working directorybooleanisDirectoryExists(String directory)Checks if a directory existsbooleanisFileExists(String filename)Checks if a file exists on remote hostbooleanisPassiveMode()this method is used to return the passive modevoidmoveToFolder(org.ftp4che.util.ftpfile.FTPFile fromFile, String targetFoldername)this method is used to move a file to remote directoryvoidreplyMessageArrived(org.ftp4che.event.FTPEvent event)voidsetBinaryMode(boolean type)public void setBinaryMode(boolean type) this method is used to set the transfer type to binaryvoidsetConnectionType(int connectiontype)this method is used to set the connection typevoidsetPassiveMode(boolean passivemode)this method is used to set the mode to passivevoidsetProxyHost(String proxyhost)this method is used to set the proxy hostvoidsetProxyPassword(String password)this method is used to set the proxy passwordvoidsetProxyPort(int proxyport)this method is used to set the proxy portvoidsetProxyUser(String username)this method is used to set the proxy usernamevoidsetTimeOut(int timeout)this method is used to set the timeoutvoiduploadFile(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.KettleExceptionthis 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.KettleExceptionpublic 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:
connectionStatusChangedin interfaceorg.ftp4che.event.FTPListener
-
replyMessageArrived
public void replyMessageArrived(org.ftp4che.event.FTPEvent event)
- Specified by:
replyMessageArrivedin 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.KettleExceptionthis 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.KettleExceptionthis 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.KettleExceptionthis 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
-
-