private void runSSHCommand( SSHShellInputs sshShellInputs, Map<String, String> returnResult, SSHService service, String sessionId, boolean saveSSHSession) { int timeoutNumber = StringUtils.toInt(sshShellInputs.getTimeout(), Constants.DEFAULT_TIMEOUT); boolean usePseudoTerminal = StringUtils.toBoolean(sshShellInputs.getPty(), Constants.DEFAULT_USE_PSEUDO_TERMINAL); boolean agentForwarding = StringUtils.toBoolean(sshShellInputs.getAgentForwarding(), Constants.DEFAULT_USE_AGENT_FORWARDING); sshShellInputs.setCharacterSet(StringUtils.toNotEmptyString(sshShellInputs.getCharacterSet(), Constants.DEFAULT_CHARACTER_SET)); // run the SSH command CommandResult commandResult = service.runShellCommand( sshShellInputs.getCommand(), sshShellInputs.getCharacterSet(), usePseudoTerminal, Constants.DEFAULT_CONNECT_TIMEOUT, timeoutNumber, agentForwarding); handleSessionClosure(sshShellInputs, service, sessionId, saveSSHSession); // populate the results populateResult(returnResult, commandResult); }
boolean usePseudoTerminal = StringUtils.toBoolean(sshShellInputs.getPty(), Constants.DEFAULT_USE_PSEUDO_TERMINAL); boolean agentForwarding = StringUtils.toBoolean(sshShellInputs.getAgentForwarding(), Constants.DEFAULT_USE_AGENT_FORWARDING); sshShellInputs.setCharacterSet(StringUtils.toNotEmptyString(sshShellInputs.getCharacterSet(), Constants.DEFAULT_CHARACTER_SET)); commandResult = service.runShell( sshShellInputs.getCommand(), sshShellInputs.getCharacterSet(), usePseudoTerminal, sshShellInputs.getConnectTimeout(), commandResult = service.runShellCommand( sshShellInputs.getCommand(), sshShellInputs.getCharacterSet(), usePseudoTerminal, sshShellInputs.getConnectTimeout(),
boolean usePseudoTerminal = StringUtils.toBoolean(sshShellInputs.getPty(), Constants.DEFAULT_USE_PSEUDO_TERMINAL); boolean agentForwarding = StringUtils.toBoolean(sshShellInputs.getAgentForwarding(), Constants.DEFAULT_USE_AGENT_FORWARDING); sshShellInputs.setCharacterSet(StringUtils.toNotEmptyString(sshShellInputs.getCharacterSet(), Constants.DEFAULT_CHARACTER_SET)); commandResult = service.runShell( sshShellInputs.getCommand(), sshShellInputs.getCharacterSet(), usePseudoTerminal, sshShellInputs.getConnectTimeout(), commandResult = service.runShellCommand( sshShellInputs.getCommand(), sshShellInputs.getCharacterSet(), usePseudoTerminal, sshShellInputs.getConnectTimeout(),