Hi,

I want to write sftp Client using apache-sshd mina client api. I am able to
connect to sftp server using apache ssh client but I do not have any idea
how to send sftp command to apache sshd server and how do I get result of
sftp client. I am totally lost. Please guide me. I have confusion on below
code:

SshClient client = SshClient.setUpDefaultClient();
        client.start();
        ClientSession session = client.connect("localhost",
port).await().getSession();
        session.authPassword("smx", "smx");
        ClientChannel channel =
session.createChannel(ClientChannel.CHANNEL_SHELL);
        ByteArrayOutputStream sent = new ByteArrayOutputStream();
        PipedOutputStream pipedIn = new TeePipedOutputStream(sent);
        channel.setIn(new PipedInputStream(pipedIn));
        ByteArrayOutputStream out = new ByteArrayOutputStream();
        ByteArrayOutputStream err = new ByteArrayOutputStream();
        channel.setOut(out);
        channel.setErr(err);
        channel.open().await();

-- 
Thanks and Regards,
Manoj Kumar
9535214528

Reply via email to