public class FTPSConnection extends Object implements org.ftp4che.event.FTPListener
| Modifier and Type | Field and 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 and Description |
|---|
FTPSConnection(int connectionType,
String hostname,
int port,
String username,
String password)
Deprecated.
|
FTPSConnection(int connectionType,
String hostname,
int port,
String username,
String password,
VariableSpace nameSpace) |
| Modifier and Type | Method and Description |
|---|---|
void |
changeDirectory(String directory)
this method change FTP working directory
|
void |
connect()
this method is used to connect to a remote host
|
void |
connectionStatusChanged(org.ftp4che.event.FTPEvent arg0) |
void |
createDirectory(String directory)
this method is used to create a directory in remote host
|
void |
deleteFile(org.ftp4che.util.ftpfile.FTPFile file)
this method is used to delete a file in remote host
|
void |
deleteFile(String filename)
this method is used to delete a file in remote host
|
void |
disconnect()
this method is used to disconnect the connection
|
void |
downloadFile(org.ftp4che.util.ftpfile.FTPFile file,
String localFilename)
this method is used to download a file from a remote host
|
int |
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 directory
|
String |
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 timeout
|
String |
getUserName() |
String |
getWorkingDirectory()
Returns the working directory
|
boolean |
isDirectoryExists(String directory)
Checks if a directory exists
|
boolean |
isFileExists(String filename)
Checks if a file exists on remote host
|
boolean |
isPassiveMode()
this method is used to return the passive mode
|
void |
moveToFolder(org.ftp4che.util.ftpfile.FTPFile fromFile,
String targetFoldername)
this method is used to move a file to remote directory
|
void |
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 binary
|
void |
setConnectionType(int connectiontype)
this method is used to set the connection type
|
void |
setPassiveMode(boolean passivemode)
this method is used to set the mode to passive
|
void |
setProxyHost(String proxyhost)
this method is used to set the proxy host
|
void |
setProxyPassword(String password)
this method is used to set the proxy password
|
void |
setProxyPort(int proxyport)
this method is used to set the proxy port
|
void |
setProxyUser(String username)
this method is used to set the proxy username
|
void |
setTimeOut(int timeout)
this method is used to set the timeout
|
void |
uploadFile(String localFileName,
String shortFileName)
this method is used to upload a file to a remote host
|
public static final String HOME_FOLDER
public static final String COMMAND_SUCCESSUL
public static final int CONNECTION_TYPE_FTP
public static final int CONNECTION_TYPE_FTP_IMPLICIT_SSL
public static final int CONNECTION_TYPE_FTP_AUTH_SSL
public static final int CONNECTION_TYPE_FTP_IMPLICIT_SSL_WITH_CRYPTED
public static final int CONNECTION_TYPE_FTP_AUTH_TLS
public static final int CONNECTION_TYPE_FTP_IMPLICIT_TLS
public static final int CONNECTION_TYPE_FTP_IMPLICIT_TLS_WITH_CRYPTED
public static final String[] connection_type_Desc
public static final String[] connection_type_Code
@Deprecated public FTPSConnection(int connectionType, String hostname, int port, String username, String password)
public FTPSConnection(int connectionType,
String hostname,
int port,
String username,
String password,
VariableSpace nameSpace)
public void setProxyHost(String proxyhost)
type - true: proxy hostpublic void setProxyPort(int proxyport)
type - true: proxy portpublic void setProxyUser(String username)
type - true: proxy usernamepublic void setProxyPassword(String password)
type - true: proxy passwordpublic void connect()
throws KettleException
KettleExceptionprotected org.ftp4che.FTPConnection getSecureDataFTPConnection(org.ftp4che.FTPConnection connection,
String password,
int timeout)
throws org.ftp4che.exception.ConfigurationException
org.ftp4che.exception.ConfigurationExceptionpublic static String getConnectionTypeDesc(int i)
public static String getConnectionType(int i)
public static int getConnectionTypeByDesc(String tt)
public static int getConnectionTypeByCode(String tt)
public static String getConnectionTypeCode(int i)
public void setBinaryMode(boolean type)
throws KettleException
type - true: BinaryKettleExceptionpublic void setPassiveMode(boolean passivemode)
type - true: passive modepublic boolean isPassiveMode()
public void setTimeOut(int timeout)
timeout - public int getTimeOut()
public String getUserName()
public String getHostName()
public void setConnectionType(int connectiontype)
type - true: connection typepublic int getConnectionType()
public void connectionStatusChanged(org.ftp4che.event.FTPEvent arg0)
connectionStatusChanged in interface org.ftp4che.event.FTPListenerpublic void replyMessageArrived(org.ftp4che.event.FTPEvent event)
replyMessageArrived in interface org.ftp4che.event.FTPListenerpublic void changeDirectory(String directory) throws KettleException
directory - change the working directoryKettleExceptionpublic void createDirectory(String directory) throws KettleException
directory - directory name on remote hostKettleExceptionpublic List<org.ftp4che.util.ftpfile.FTPFile> getFileList(String folder) throws KettleException
KettleExceptionpublic void downloadFile(org.ftp4che.util.ftpfile.FTPFile file,
String localFilename)
throws KettleException
file - remote file to downloadlocalFilename - target filenameKettleExceptionpublic void uploadFile(String localFileName, String shortFileName) throws KettleException
localFileName - Local full filenameshortFileName - Filename in remote hostKettleExceptionpublic String[] getFileNames() throws KettleException
KettleExceptionpublic void deleteFile(org.ftp4che.util.ftpfile.FTPFile file)
throws KettleException
file - File on remote host to deleteKettleExceptionpublic void deleteFile(String filename) throws KettleException
filename - Name of file on remote host to deleteKettleExceptionpublic void moveToFolder(org.ftp4che.util.ftpfile.FTPFile fromFile,
String targetFoldername)
throws KettleException
fromFile - File on remote host to movetargetFoldername - Target remote folderKettleExceptionpublic boolean isDirectoryExists(String directory)
public boolean isFileExists(String filename)
filename - the name of the file to checkpublic String getWorkingDirectory() throws Exception
Exceptionpublic void disconnect()
Copyright © 2020 Hitachi Vantara. All rights reserved.