com.clickntap.utils
Class SSHUtils

java.lang.Object
  extended by com.clickntap.utils.SSHUtils

public class SSHUtils
extends Object


Field Summary
static int DEFAULTPORT
           
static String MODE644
           
 
Constructor Summary
SSHUtils()
           
 
Method Summary
static ch.ethz.ssh2.Connection connect(String hostname, int port, String username, String password)
           
static ch.ethz.ssh2.Connection connect(String hostname, String username, String password)
           
static String exec(ch.ethz.ssh2.Connection conn, String command)
           
static String exec(ch.ethz.ssh2.Connection conn, String command, String out)
           
static String exec(String hostname, String username, String password, String command)
           
static void scp(String hostname, String username, String password, String localFile, String remoteTargetDirectory)
           
static void scp(String hostname, String username, String password, String localFile, String remoteTargetDirectory, String mode)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MODE644

public static final String MODE644
See Also:
Constant Field Values

DEFAULTPORT

public static final int DEFAULTPORT
See Also:
Constant Field Values
Constructor Detail

SSHUtils

public SSHUtils()
Method Detail

exec

public static String exec(String hostname,
                          String username,
                          String password,
                          String command)
                   throws IOException
Throws:
IOException

connect

public static ch.ethz.ssh2.Connection connect(String hostname,
                                              String username,
                                              String password)
                                       throws IOException
Throws:
IOException

exec

public static String exec(ch.ethz.ssh2.Connection conn,
                          String command,
                          String out)
                   throws IOException
Throws:
IOException

exec

public static String exec(ch.ethz.ssh2.Connection conn,
                          String command)
                   throws IOException
Throws:
IOException

connect

public static ch.ethz.ssh2.Connection connect(String hostname,
                                              int port,
                                              String username,
                                              String password)
                                       throws IOException
Throws:
IOException

scp

public static void scp(String hostname,
                       String username,
                       String password,
                       String localFile,
                       String remoteTargetDirectory,
                       String mode)
                throws IOException
Throws:
IOException

scp

public static void scp(String hostname,
                       String username,
                       String password,
                       String localFile,
                       String remoteTargetDirectory)
                throws IOException
Throws:
IOException


Copyright © 2014. All rights reserved.