public void showMessage(String message) { if (getConfiguration().getBannerHandler() != null) { getConfiguration().getBannerHandler().banner(message); } }
public SshExtendedStreamChannel createCommand(String command) throws SshException { try { ChannelExec channel = (ChannelExec) session.openChannel("exec"); channel.setCommand(command); return new JschStreamChannel(getConfiguration(), channel) { protected void onChannelClose() throws SshException { channelCount--; } protected void onChannelOpen() throws SshException { channelCount++; } }; } catch (JSchException e) { throw new SshException("Failed to create shell channel.", e); } }
public SshShell createShell(String termType, int colWidth, int rowHeight, int pixWidth, int pixHeight, byte[] terminalModes) throws SshException { try { ChannelShell channel = (ChannelShell) session.openChannel("shell"); if (termType != null) { channel.setTerminalMode(terminalModes == null || terminalModes.length == 0 ? new byte[0] : terminalModes); channel.setPtyType(termType, colWidth, rowHeight, pixWidth, pixHeight); } return new JschSshShell(getConfiguration(), channel) { protected void onChannelClose() throws SshException { channelCount--; } protected void onShellOpen() throws SshException { channelCount++; } }; } catch (JSchException e) { throw new SshException("Failed to create shell channel.", e); } }
SshConfiguration configuration = getConfiguration(); try { session.connect(Integer.parseInt(configuration.getProperties().getProperty(JschSshProvider.CFG_SESSION_CONNECT_TIMEOUT,
public int check(final String host, final byte[] key) { SshHostKeyValidator hostKeyValidator = getConfiguration().getHostKeyValidator(); if (hostKeyValidator != null) { try {
client.setHostKeyRepository(new HostKeyRepositoryBridge(client.getHostKeyRepository())); session = client.getSession(username, hostname, port); final SocketFactory socketFactory = getConfiguration().getSocketFactory(); if (socketFactory != null) { session.setSocketFactory(new com.jcraft.jsch.SocketFactory() { SshConfiguration configuration = getConfiguration();