The SUMO toolbox  2018a
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Pages
Public Member Functions | Static Public Member Functions | List of all members
SSHWrapper Class Reference

A wrapper class for all kinds of shell commands that need to be executed on a remote host over ssh. More...

Public Member Functions

 SSHWrapper (String identityFile, String identityFilePwd, String username, String host, int port) throws IOException
 
void connect () throws IOException
 Authenticate to the server. More...
 
String getHost ()
 
int getPort ()
 
String getUserName ()
 
boolean isConnected ()
 
void copyDirectory (String localDir, String remoteDir) throws Exception
 
int getFileSize (String file) throws Exception
 
void createFile (String path, String content) throws Exception
 
boolean removeFile (String file) throws Exception
 
void removeDir (String directory) throws Exception
 
void makeDir (String directory) throws Exception
 
String remoteExec (String command) throws Exception
 
String remoteExec (String command, String ignorePrefix) throws Exception
 
LinkedList< String > remoteExecAsList (String command) throws Exception
 
LinkedList< String > remoteExecAsList (String command, String ignorePrefix) throws IOException
 
void scpFrom (String remoteFile, String localFile) throws Exception
 
void scpTo (String localFile, String remoteFile) throws Exception
 
void close ()
 

Static Public Member Functions

static void main (String[] arg)
 

Detailed Description

A wrapper class for all kinds of shell commands that need to be executed on a remote host over ssh.

Constructor & Destructor Documentation

SSHWrapper ( String  identityFile,
String  identityFilePwd,
String  username,
String  host,
int  port 
) throws IOException
inline

Member Function Documentation

void close ( )
inline
void connect ( ) throws IOException
inline

Authenticate to the server.

void copyDirectory ( String  localDir,
String  remoteDir 
) throws Exception
inline
void createFile ( String  path,
String  content 
) throws Exception
inline
int getFileSize ( String  file) throws Exception
inline
String getHost ( )
inline
int getPort ( )
inline
String getUserName ( )
inline
boolean isConnected ( )
inline
static void main ( String[]  arg)
inlinestatic
void makeDir ( String  directory) throws Exception
inline
String remoteExec ( String  command) throws Exception
inline
String remoteExec ( String  command,
String  ignorePrefix 
) throws Exception
inline
LinkedList<String> remoteExecAsList ( String  command) throws Exception
inline
LinkedList<String> remoteExecAsList ( String  command,
String  ignorePrefix 
) throws IOException
inline
void removeDir ( String  directory) throws Exception
inline
boolean removeFile ( String  file) throws Exception
inline
void scpFrom ( String  remoteFile,
String  localFile 
) throws Exception
inline
void scpTo ( String  localFile,
String  remoteFile 
) throws Exception
inline

The documentation for this class was generated from the following file: