Class DefaultSshClient
- java.lang.Object
-
- jenkins.plugins.ssh2easy.gssh.client.AbstractSshClient
-
- jenkins.plugins.ssh2easy.gssh.client.DefaultSshClient
-
- All Implemented Interfaces:
SshClient
- Direct Known Subclasses:
JenkinsSshClient
public class DefaultSshClient extends AbstractSshClient
This is Ssh handler , user for handling SSH related event and requirments- Author:
- Jerry Cai
-
-
Field Summary
Fields Modifier and Type Field Description static String
SSH_BEY
-
Fields inherited from class jenkins.plugins.ssh2easy.gssh.client.AbstractSshClient
LATEEST_EXEC_SHELL_DEBUG, TEMP_PATH
-
Fields inherited from interface jenkins.plugins.ssh2easy.gssh.client.SshClient
STATUS_FAILED, STATUS_SUCCESS
-
-
Constructor Summary
Constructors Constructor Description DefaultSshClient(String ip, int port, String username, String password)
DefaultSshClient(ServerGroup serverGroup, String ip)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description com.jcraft.jsch.Session
createSession(PrintStream logger)
int
downloadFile(PrintStream logger, String remoteFile, String localFolder, String fileName)
int
executeCommand(PrintStream logger, String command)
int
executeShell(PrintStream logger, String shell)
String
getIp()
String
getPassword()
int
getPort()
String
getUsername()
static SshClient
newInstance(String ip, int port, String username, String password)
static SshClient
newInstance(ServerGroup group, String ip)
boolean
prepareUpload(com.jcraft.jsch.ChannelSftp sftpChannel, String path, boolean overwrite)
void
setIp(String ip)
void
setPassword(String password)
void
setPort(int port)
void
setUsername(String username)
boolean
testConnection(PrintStream logger)
String
toString()
int
uploadFile(PrintStream logger, String fileName, InputStream fileContent, String serverLocation)
protected String
wrapperInput(String input)
-
Methods inherited from class jenkins.plugins.ssh2easy.gssh.client.AbstractSshClient
chmod, chown, downloadFile, executeCommand, executeShellByFTP, executeShellByFTP, mv, rm_Rf, uploadFile, uploadFile
-
-
-
-
Field Detail
-
SSH_BEY
public static final String SSH_BEY
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
DefaultSshClient
public DefaultSshClient(ServerGroup serverGroup, String ip)
-
-
Method Detail
-
newInstance
public static SshClient newInstance(String ip, int port, String username, String password)
-
newInstance
public static SshClient newInstance(ServerGroup group, String ip)
-
createSession
public com.jcraft.jsch.Session createSession(PrintStream logger)
-
uploadFile
public int uploadFile(PrintStream logger, String fileName, InputStream fileContent, String serverLocation)
-
downloadFile
public int downloadFile(PrintStream logger, String remoteFile, String localFolder, String fileName)
-
executeShell
public int executeShell(PrintStream logger, String shell)
-
executeCommand
public int executeCommand(PrintStream logger, String command)
-
testConnection
public boolean testConnection(PrintStream logger)
-
getIp
public String getIp()
-
setIp
public void setIp(String ip)
-
getPort
public int getPort()
-
setPort
public void setPort(int port)
-
getUsername
public String getUsername()
-
setUsername
public void setUsername(String username)
-
getPassword
public String getPassword()
-
setPassword
public void setPassword(String password)
-
prepareUpload
public boolean prepareUpload(com.jcraft.jsch.ChannelSftp sftpChannel, String path, boolean overwrite) throws com.jcraft.jsch.SftpException, IOException, FileNotFoundException
- Throws:
com.jcraft.jsch.SftpException
IOException
FileNotFoundException
-
-