@Override public int getWidth() { return context.getWidth(); }
public Command create() { return new CRaSHCommand(this); } }
@Override public int getHeight() { return context.getHeight(); }
public Command createCommand(String command) { // Just in case command = command.trim(); // log.log(Level.FINE, "About to execute shell command " + command); for (CommandPlugin plugin : pluginContext.getPlugins(CommandPlugin.class)) { Command cmd = plugin.createCommand(command); if (cmd != null) { return cmd; } } return new FailCommand("Unrecognized command " + command); } }
SSHInlineShellProcessContext context = new SSHInlineShellProcessContext(new SSHContext(env), shellProcess, out, err); int exitStatus = OK; String exitMsg = null; ShellResponse response = context.getResponse(); if (response instanceof ShellResponse.Ok) {
keyPairProvider = new URLKeyPairProvider(serverKey); SSHLifeCycle lifeCycle = new SSHLifeCycle( getContext(), encoding, keyPairProvider, authPlugins); lifeCycle.init();
server.setShellFactory(new CRaSHCommandFactory(factory, encoding)); server.setCommandFactory(new SCPCommandFactory(context)); server.setKeyPairProvider(keyPairProvider); namedFactoryList.add(plugin.getFactory());
public SSHContext(Environment env) { if (env == null) { throw new NullPointerException("No null env"); } // Integer verase = env.getPtyModes().get(PtyMode.VERASE); String LC_CTYPE = env.getEnv().get("LC_CTYPE"); Charset encoding; if (LC_CTYPE != null) { encoding = parseEncoding(LC_CTYPE); } else { encoding = null; } // this.env = env; this.verase = verase != null ? verase : -1; this.encoding = encoding; }
public String getProperty(String name) { return context.getProperty(name); }
public String getProperty(String name) { return command.getContext().getProperty(name); }
public int getWidth() { return command.getContext().getWidth(); }
public int getHeight() { return command.getContext().getHeight(); }
@Override public void destroy() { if (lifeCycle != null) { log.log(Level.INFO, "Shutting down SSHD"); lifeCycle.destroy(); lifeCycle = null; } } }
public void start(Environment env) throws IOException { context = new SSHContext(env); encoding = context.encoding != null ? context.encoding.name() : factory.encoding.name(); thread = new Thread(this, "CRaSH"); // thread.start(); }
public int getHeight() { int height = context.getHeight(); if (height == -1) { if (!msgDone) { msgDone = true; out.print(MSG); out.flush(); } } return height; }
public int getWidth() { int width = context.getWidth(); if (width == -1) { if (!msgDone) { msgDone = true; out.print(MSG); out.flush(); } } return width; }
public Command create() { return new CRaSHCommand(this); } }
public void testParseLC_CTYPE() { assertEquals(null, SSHContext.parseEncoding("")); assertEquals(null, SSHContext.parseEncoding("fr_FR")); assertEquals(null, SSHContext.parseEncoding("fr_FR@euro")); assertEquals(Utils.UTF_8, SSHContext.parseEncoding("UTF-8")); assertEquals(Utils.UTF_8, SSHContext.parseEncoding("fr_FR.UTF-8")); assertEquals(Utils.UTF_8, SSHContext.parseEncoding("fr_FR.UTF-8@euro")); } }
@Override public int getHeight() { return context.getHeight(); }
@Override public int getHeight() { return context.getHeight(); }