Examples of CommandFactory


Examples of org.apache.ftpserver.command.CommandFactory

        listener = listeners.get("listener2");
        assertNotNull(listener);
        assertTrue(listener instanceof MyCustomListener);
        assertEquals(2224, listener.getPort());

        CommandFactory cf = server.getCommandFactory();
        assertTrue(cf.getCommand("FOO") instanceof HELP);
        assertTrue(cf.getCommand("FOO2") instanceof STAT);

        List<String> languages = server.getServerContext().getMessageResource()
                .getAvailableLanguages();

        assertEquals(2, languages.size());
View Full Code Here

Examples of org.apache.ftpserver.command.CommandFactory

            final FtpRequest request) throws Exception {
        try {
            session.updateLastAccessTime();
           
            String commandName = request.getCommand();
            CommandFactory commandFactory = context.getCommandFactory();
            Command command = commandFactory.getCommand(commandName);

            // make sure the user is authenticated before he issues commands
            if (!session.isLoggedIn()
                    && !isCommandOkWithoutAuthentication(commandName)) {
                session.write(LocalizedFtpReply.translate(session, request,
View Full Code Here

Examples of org.apache.ftpserver.interfaces.CommandFactory

    }

    public void messageReceived( final FtpIoSession session, final FtpRequest request ) throws Exception {
        try {
            String commandName = request.getCommand();
            CommandFactory commandFactory = context.getCommandFactory();
            Command command = commandFactory.getCommand(commandName);
           
           
            if(command != null) {
              synchronized (session) {
                command.execute(session, context, request);
View Full Code Here

Examples of org.apache.hadoop.fs.shell.CommandFactory

  }
 
  protected void init() throws IOException {
    getConf().setQuietMode(true);
    if (commandFactory == null) {
      commandFactory = new CommandFactory(getConf());
      commandFactory.addObject(new Help(), "-help");
      commandFactory.addObject(new Usage(), "-usage");
      registerCommands(commandFactory);
    }
  }
View Full Code Here

Examples of org.apache.hadoop.fs.shell.CommandFactory

  }
 
  protected void init() throws IOException {
    getConf().setQuietMode(true);
    if (commandFactory == null) {
      commandFactory = new CommandFactory(getConf());
      commandFactory.addObject(new Help(), "-help");
      commandFactory.addObject(new Usage(), "-usage");
      registerCommands(commandFactory);
    }
  }
View Full Code Here

Examples of org.apache.sshd.server.CommandFactory

        final ProcessShellFactory processShellFactory =
            new ProcessShellFactory( new String[]{ "/bin/sh", "-i", "-l" } );
        sshd.setShellFactory( processShellFactory );

        CommandFactory delegateCommandFactory = new CommandFactory()
        {
            public Command createCommand( String command )
            {
                return new ShellCommand( command );
            }
View Full Code Here

Examples of org.apache.sshd.server.CommandFactory

            public boolean canConnect(SshdSocketAddress address, Session session) {
                return true;
            }
        });
        sshd.setCommandFactory(new ScpCommandFactory(new CommandFactory() {
            public Command createCommand(String command) {
                EnumSet<ProcessShellFactory.TtyOptions> ttyOptions;
                if (OsUtils.isUNIX()) {
                    ttyOptions = EnumSet.of(ProcessShellFactory.TtyOptions.ONlCr);
                } else {
View Full Code Here

Examples of org.apache.sshd.server.CommandFactory

        sshd = SshServer.setUpDefaultServer();
        sshd.setPort(port);
        sshd.setKeyPairProvider(Utils.createTestHostKeyProvider());
        sshd.setShellFactory(new TestEchoShellFactory());
        sshd.setCommandFactory(new CommandFactory() {
            public Command createCommand(String command) {
                return new UnknownCommand(command);
            }
        });
        sshd.setPasswordAuthenticator(new BogusPasswordAuthenticator());
View Full Code Here

Examples of org.apache.sshd.server.CommandFactory

    public void setUp() throws Exception {
        port = Utils.getFreePort();
        sshd = SshServer.setUpDefaultServer();
        sshd.setPort(port);
        sshd.setKeyPairProvider(Utils.createTestHostKeyProvider());
        sshd.setCommandFactory(new CommandFactory() {
            public Command createCommand(String command) {
                return new UnknownCommand(command);
            }
        });
        sshd.getProperties().put(SshServer.AUTH_METHODS, "publickey");
View Full Code Here

Examples of org.apache.sshd.server.CommandFactory

        sshd = SshServer.setUpDefaultServer();
        sshd.setPort(port);
        sshd.setKeyPairProvider(Utils.createTestHostKeyProvider());
        sshd.setShellFactory(new TestEchoShellFactory());
        sshd.setCommandFactory(new CommandFactory() {
            public Command createCommand(String command) {
                return new UnknownCommand(command);
            }
        });
        sshd.setPasswordAuthenticator(new BogusPasswordAuthenticator());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.