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));
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));
sshShellInputs.setCommand(command); sshShellInputs.setArguments(arguments); sshShellInputs.setCharacterSet(characterSet); sshShellInputs.setPty(pty); sshShellInputs.setAgentForwarding(agentForwarding);
sshShellInputs.setCommand(command); sshShellInputs.setArguments(arguments); sshShellInputs.setCharacterSet(characterSet); sshShellInputs.setPty(pty); sshShellInputs.setAgentForwarding(agentForwarding);
sshShellInputs.setCommand(command); sshShellInputs.setArguments(arguments); sshShellInputs.setCharacterSet(characterSet); sshShellInputs.setPty(pty); sshShellInputs.setAgentForwarding(agentForwarding);