Class SSHUtil


  • public class SSHUtil
    extends Object
    Author:
    Rajiv Mordani
    • 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 String checkString​(String s)
        Convert empty string to null.
      • getExistingKeyFile

        public static String getExistingKeyFile()
      • getDefaultKeyFile

        public static String getDefaultKeyFile()
      • isEncryptedKey

        public static boolean isEncryptedKey​(String keyFile)
                                      throws CommandException
        Simple method to validate an encrypted key file
        Returns:
        true|false
        Throws:
        CommandException
      • validateKeyFile

        public static boolean validateKeyFile​(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