org.glassfish.cluster.ssh.util
Class SSHUtil

java.lang.Object
  extended by org.glassfish.cluster.ssh.util.SSHUtil

public class SSHUtil
extends java.lang.Object

Author:
Rajiv Mordani

Constructor Summary
SSHUtil()
           
 
Method Summary
static java.lang.String checkString(java.lang.String s)
          Convert empty string to null.
static java.lang.String getDefaultKeyFile()
           
static java.lang.String getExistingKeyFile()
           
static boolean isEncryptedKey(java.lang.String keyFile)
          Simple method to validate an encrypted key file
static void register(com.trilead.ssh2.Connection connection)
          Registers a connection for cleanup when the plugin is stopped.
static void unregister(com.trilead.ssh2.Connection connection)
          Unregisters a connection for cleanup when the plugin is stopped.
static boolean validateKeyFile(java.lang.String file)
          This method validates either private or public key file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SSHUtil

public SSHUtil()
Method Detail

register

public static void register(com.trilead.ssh2.Connection connection)
Registers a connection for cleanup when the plugin is stopped.

Parameters:
connection - The connection.

unregister

public static void unregister(com.trilead.ssh2.Connection connection)
Unregisters a connection for cleanup when the plugin is stopped.

Parameters:
connection - The connection.

checkString

public static java.lang.String checkString(java.lang.String s)
Convert empty string to null.


getExistingKeyFile

public static java.lang.String getExistingKeyFile()

getDefaultKeyFile

public static java.lang.String getDefaultKeyFile()

isEncryptedKey

public static boolean isEncryptedKey(java.lang.String keyFile)
                              throws CommandException
Simple method to validate an encrypted key file

Returns:
true|false
Throws:
CommandException

validateKeyFile

public static boolean validateKeyFile(java.lang.String file)
                               throws CommandException
This method validates either private or public key file. In case of private key, it parses the key file contents to verify if it indeed contains a key

Parameters:
file - the key file
Returns:
success if file exists, false otherwise
Throws:
CommandException


Copyright © 2012 GlassFish Community. All Rights Reserved.