Hi,

It's not available out of the box, but in my case it ended up being
not that difficult after all.
I built my own custom implementation of FtpServer with "mixed-in"
implementation of SSHD to accomplish what you are looking for.

We have a custom FileSystemFactory/FileSystem/FtpFile implementation
(to provide to each logged user a modified version of the file system
based on their access permissions)

I got the FtpServer portion working first, and then i "mixed in" the
SSHD implementation by implementing all the corresponding interfaces.
So in my implementation:
ToliFtpFile extends NativeFtpFile implements SshFile , and
ToliFileSystemFactory implements FileSystemFactory,
org.apache.sshd.server.FileSystemFactory and
ToliFileSystem extends NativeFileSystemView implements
org.apache.sshd.server.FileSystemView

(class names changed to protect company secrets):

The shared classes are reusing functions as much as possible to
implement the equivalent methods (ie listFiles(), getFile(), etc). For
some it was fairly straightforward to channel all the code through
same codepath, for some it wasn't - so it's not as "clean" as I would
like.

In my "main" i just start both FtpServer and SSHD processes
(configured via Spring):
        FtpServer ftpServer = ftpContext.getBean("ftpServer", FtpServer.class);
        SshServer sshd = ftpContext.getBean("sshdServer", SshServer.class);
        ftpServer.start();
        sshdServer.start();

It turned out not as "elegant" or "clean" as I had hoped, mostly b/c
of the inconsistencies between the interfaces in FtpServer/SSHD....
Had they both shared the same FtpFileBase superclass, it'd be a bit
cleaner, but it was fairly straightforward to implement.

Hope this helps. I'll run the possibility of publishing the sample
code past "management", but the "guts" of the implementation are
fairly specific to what we do at work, so it may not be as helpful

toli

On Sat, Apr 16, 2011 at 3:17 PM, Toadie <[email protected]> wrote:
> Does the latest SSHD release support SFTP client?  I saw that there
> were test cases leveraging JCraft.com JSCH as the SFTP Client but am
> wondering if SFTP is natively supported within Apache MINA SSHD.
> Thanks
>

Reply via email to