Package com.privalia.qa.utils
Class RemoteSSHConnection
- java.lang.Object
-
- com.privalia.qa.utils.RemoteSSHConnection
-
public class RemoteSSHConnection extends Object
-
-
Constructor Summary
Constructors Constructor Description RemoteSSHConnection(String user, String password, String remoteHost, String pemFile)
Default constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
checkAck(InputStream in)
UTILSvoid
closeConnection()
Close connectionvoid
copyFrom(String remotePath, String localPath)
Copy remotePath to localPath using the session createdvoid
copyTo(String localPath, String remotePath)
Copy localPath to remotePath using the session createdint
getExitStatus()
String
getResult()
com.jcraft.jsch.Session
getSession()
void
runCommand(String command)
Execute the command in the session createdvoid
setExitStatus(int exitStatus)
void
setResult(String result)
void
setSession(com.jcraft.jsch.Session session)
-
-
-
Method Detail
-
getSession
public com.jcraft.jsch.Session getSession()
-
setSession
public void setSession(com.jcraft.jsch.Session session)
-
getResult
public String getResult()
-
setResult
public void setResult(String result)
-
getExitStatus
public int getExitStatus()
-
setExitStatus
public void setExitStatus(int exitStatus)
-
copyTo
public void copyTo(String localPath, String remotePath) throws Exception
Copy localPath to remotePath using the session created- Parameters:
localPath
- the local pathremotePath
- the remote path- Throws:
Exception
- Exception
-
runCommand
public void runCommand(String command) throws Exception
Execute the command in the session created- Parameters:
command
- the command to execute- Throws:
Exception
- Exception
-
copyFrom
public void copyFrom(String remotePath, String localPath) throws Exception
Copy remotePath to localPath using the session created- Parameters:
remotePath
- the remote pathlocalPath
- the local path- Throws:
Exception
- Exception
-
closeConnection
public void closeConnection() throws Exception
Close connection- Throws:
Exception
- Exception
-
checkAck
public int checkAck(InputStream in) throws IOException
UTILS- Parameters:
in
- the in- Returns:
- the int
- Throws:
IOException
- the io exception
-
-