Package org.pentaho.di.job.entries.sftp
Class SFTPClient
- java.lang.Object
-
- org.pentaho.di.job.entries.sftp.SFTPClient
-
public class SFTPClient extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static String
HTTP_DEFAULT_PORT
static String
PROXY_TYPE_HTTP
static String
PROXY_TYPE_SOCKS5
static String
SOCKS5_DEFAULT_PORT
static int
SSH_DEFAULT_PORT
-
Constructor Summary
Constructors Constructor Description SFTPClient(InetAddress serverIP, int serverPort, String userName)
Init Helper Class with connection settingsSFTPClient(InetAddress serverIP, int serverPort, String userName, String privateKeyFilename)
Init Helper Class with connection settingsSFTPClient(InetAddress serverIP, int serverPort, String userName, String privateKeyFilename, String passPhrase)
Init Helper Class with connection settings
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
chdir(String dirToChangeTo)
void
createFolder(String path)
Creates the given folder.void
delete(String file)
String[]
dir()
void
disconnect()
boolean
folderExists(String foldername)
void
get(String localFilePath, String remoteFile)
Deprecated.void
get(org.apache.commons.vfs2.FileObject localFile, String remoteFile)
String
getCompression()
org.apache.commons.vfs2.FileType
getFileType(String filename)
String
getPassword()
String
GetPrivateKeyFileName()
String
GetPrivateKeyPassPhrase()
InetAddress
getServerIP()
int
getServerPort()
String
getUserName()
void
login(String password)
void
put(InputStream inputStream, String remoteFile)
void
put(org.apache.commons.vfs2.FileObject fileObject, String remoteFile)
String
pwd()
void
renameFile(String sourcefilename, String destinationfilename)
Rename the file.void
setCompression(String compression)
void
setProxy(String host, String port, String user, String pass, String proxyType)
-
-
-
Field Detail
-
PROXY_TYPE_SOCKS5
public static final String PROXY_TYPE_SOCKS5
- See Also:
- Constant Field Values
-
PROXY_TYPE_HTTP
public static final String PROXY_TYPE_HTTP
- See Also:
- Constant Field Values
-
HTTP_DEFAULT_PORT
public static final String HTTP_DEFAULT_PORT
- See Also:
- Constant Field Values
-
SOCKS5_DEFAULT_PORT
public static final String SOCKS5_DEFAULT_PORT
- See Also:
- Constant Field Values
-
SSH_DEFAULT_PORT
public static final int SSH_DEFAULT_PORT
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
SFTPClient
public SFTPClient(InetAddress serverIP, int serverPort, String userName) throws org.pentaho.di.core.exception.KettleJobException
Init Helper Class with connection settings- Parameters:
serverIP
- IP address of remote serverserverPort
- port of remote serveruserName
- username of remote server- Throws:
org.pentaho.di.core.exception.KettleJobException
-
SFTPClient
public SFTPClient(InetAddress serverIP, int serverPort, String userName, String privateKeyFilename) throws org.pentaho.di.core.exception.KettleJobException
Init Helper Class with connection settings- Parameters:
serverIP
- IP address of remote serverserverPort
- port of remote serveruserName
- username of remote serverprivateKeyFilename
- filename of private key- Throws:
org.pentaho.di.core.exception.KettleJobException
-
SFTPClient
public SFTPClient(InetAddress serverIP, int serverPort, String userName, String privateKeyFilename, String passPhrase) throws org.pentaho.di.core.exception.KettleJobException
Init Helper Class with connection settings- Parameters:
serverIP
- IP address of remote serverserverPort
- port of remote serveruserName
- username of remote serverprivateKeyFilename
- filename of private keypassPhrase
- passphrase- Throws:
org.pentaho.di.core.exception.KettleJobException
-
-
Method Detail
-
login
public void login(String password) throws org.pentaho.di.core.exception.KettleJobException
- Throws:
org.pentaho.di.core.exception.KettleJobException
-
chdir
public void chdir(String dirToChangeTo) throws org.pentaho.di.core.exception.KettleJobException
- Throws:
org.pentaho.di.core.exception.KettleJobException
-
dir
public String[] dir() throws org.pentaho.di.core.exception.KettleJobException
- Throws:
org.pentaho.di.core.exception.KettleJobException
-
get
public void get(org.apache.commons.vfs2.FileObject localFile, String remoteFile) throws org.pentaho.di.core.exception.KettleJobException
- Throws:
org.pentaho.di.core.exception.KettleJobException
-
get
@Deprecated public void get(String localFilePath, String remoteFile) throws org.pentaho.di.core.exception.KettleJobException
Deprecated.- Parameters:
localFilePath
-remoteFile
-- Throws:
org.pentaho.di.core.exception.KettleJobException
-
pwd
public String pwd() throws org.pentaho.di.core.exception.KettleJobException
- Throws:
org.pentaho.di.core.exception.KettleJobException
-
put
public void put(org.apache.commons.vfs2.FileObject fileObject, String remoteFile) throws org.pentaho.di.core.exception.KettleJobException
- Throws:
org.pentaho.di.core.exception.KettleJobException
-
put
public void put(InputStream inputStream, String remoteFile) throws org.pentaho.di.core.exception.KettleJobException
- Throws:
org.pentaho.di.core.exception.KettleJobException
-
delete
public void delete(String file) throws org.pentaho.di.core.exception.KettleJobException
- Throws:
org.pentaho.di.core.exception.KettleJobException
-
createFolder
public void createFolder(String path) throws org.pentaho.di.core.exception.KettleJobException
Creates the given folder. The {@param path} can be either absolute or relative. Allows creation of nested folders.- Throws:
org.pentaho.di.core.exception.KettleJobException
-
renameFile
public void renameFile(String sourcefilename, String destinationfilename) throws org.pentaho.di.core.exception.KettleJobException
Rename the file.- Throws:
org.pentaho.di.core.exception.KettleJobException
-
getFileType
public org.apache.commons.vfs2.FileType getFileType(String filename) throws org.pentaho.di.core.exception.KettleJobException
- Throws:
org.pentaho.di.core.exception.KettleJobException
-
folderExists
public boolean folderExists(String foldername)
-
setProxy
public void setProxy(String host, String port, String user, String pass, String proxyType) throws org.pentaho.di.core.exception.KettleJobException
- Throws:
org.pentaho.di.core.exception.KettleJobException
-
disconnect
public void disconnect()
-
GetPrivateKeyFileName
public String GetPrivateKeyFileName()
-
GetPrivateKeyPassPhrase
public String GetPrivateKeyPassPhrase()
-
getPassword
public String getPassword()
-
getServerPort
public int getServerPort()
-
getUserName
public String getUserName()
-
getServerIP
public InetAddress getServerIP()
-
setCompression
public void setCompression(String compression)
-
getCompression
public String getCompression()
-
-