@ Override public String sendCommand2 ( String command ) throws IOException { String str = null ; SshConnection ssh = null ; try { ssh = SshConnectionFactory . getConnection ( config . getGerritHostName ( ) , config . getGerritSshPort ( ) , config . getGerritProxy ( ) , config . getGerritAuthentication ( ) ) ; str = ssh . executeCommand ( command ) ; } catch ( Exception ex ) { throw new IOException ( "Error during sending command" , ex ) ; } finally { if ( ssh != null ) { ssh . disconnect ( ) ; } } return str ; }
Runs a command on the gerrit server and returns the output from the command .