The SftpFileSystem is a wrapper around an SFTP connection. In the case of
Will's project you need a wrapper around the FTP connection as the 'local'
filesystem of the SFTP server.

Cheers, Dennis

On Fri, 8 Dec 2023 at 13:12, Guillaume Nodet <[email protected]> wrote:

> Maybe I misunderstand something, but Mina SSHD *provides* a
> FileSystemFactory that completely supports SFTP.
> Why would you want to re-implement it ?
> See
>
> https://github.com/apache/mina-sshd/blob/master/docs/sftp.md#using-sftpfilesystemprovider-to-create-an-sftpfilesystem
>
> Guillaume
>
> Le jeu. 7 déc. 2023 à 21:00, Soderberg, Will <
> [email protected]> a écrit :
>
> > Hello,
> >
> > Haven't had much luck finding answers on stackoverflow etc so trying
> here.
> >
> > I'm working on a project which uses both Apache MINA and Apache
> > commons-net FTPClient to create a protocol adapter that provides an SFTP
> > wrapper to access FTP servers (which cannot be upgraded to SFTP for
> complex
> > reasons).
> >
> > I've been able to get authentication and file transfer working by
> > hardcoding the paths, but what I'm struggling with is file+folder
> listing.
> > FTPClient has a very simple API for this, but MINA seems to require an
> > extremely sophisticated implementation of java.nio.file.FileSystem,
> > FileSystemFactory, Path, etc to make this work.  I was hoping that
> > implementing SftpFileSystemAccessor.openDirectory would be enough, but
> when
> > setting breakpoints I'm not seeing that method be called in the way I
> would
> > expect for it to be the solution.
> >
> > Am I overthinking this?  Which approach is correct for what I'm looking
> to
> > do?  I can't provide a very complete implementation of FileSystem due to
> > the limitations of FTP, but it seems like MINA only really uses a few
> > methods from it anyway.
> >
> >
> > Thank you
> > Will
> >
>
>
> --
> ------------------------
> Guillaume Nodet
>


-- 
D.G. van der Laan, MSc
Sr. Software Engineer, team Content Management System & Online Development
Center for Information Technology
+31 (0)50 363 9273

Reply via email to