[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [ecf-dev] Using ECF FileTransfer to browse remote file system

Hi J,

On 9/29/2014 9:26 PM, J Langley wrote:
Hello,

I am trying to find a way to list the files on a remote file system. I have implemented and tested the SCP provider for sending and receiving files, but I need a way to browse remote files to retrieve. The only access I have is through an SSH connection. I am contemplating an implementation of the IRemoteFileSystemBrowser interface and using the ScpOutgoingFileTransfer class as a template for opening a channel with JSch.

Just to be clear, the file transfer browse API impl is just missing from the scp provider...it was simply never added.


What I would suggest is that if you are contemplating adding support for this API in the scp provider that you open an enhancement request/bug for ECF, and I and other ECF committers will help with the implementation/testing. If you are OK with it, it could then be contributed and become part of future ECF releases. I encourage you to make such a contribution...in return I will personally guarantee assistance/help with the implementation.



Unless of course, someone has already done this?

Any thoughts on whether or not this is the right way to go?

My starting suggestion (lots more details on bug of course) would be model things off of the structure of things already implemented in the httpclient4 provider. This provider is located here in the git repository:


http://git.eclipse.org/c/ecf/org.eclipse.ecf.git/tree/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient4

For example, see this class:

org.eclipse.ecf.provider.filetransfer.httpclient4.HttpClientBrowseFileTransferFactory

This class is registered as an extension via the org.eclipse.ecf.provider.filetransfer.browseFileTransferProtocolFactory extension point in the httpclient4 provider's plugin.xml.

Similarly, we can enhance the scp provider by:

1) Creating a new class: org.eclipse.ecf.internal.provider.scp.ScpBrowseFileTransferFactory implements IRemoteFileSystemBrowserFactory
2) Creating a new class: org.eclipse.ecf.internal.provider.scp.ScpBrowseFileTransfer implements IRemoteFileSystemBrowser
3) Implement IRemoteFileSystemBrowserFactory.newInstance() that returns a new instance of ScpBrowseFileTransfer
4) Implement ScpBrowseFileTransfer. Possibly using org.eclipse.ecf.provider.filetransfer.browse.AbstractFileSystemBrowser as superclass to make it easier to implement. This class will contain the actual scp calls to browse the remote file system.
5) Register your ScpBrowseFileTransferFactory as an extension via the browseFileTransferProtocolFactory extension point.


Like I mention above, the httpclient4 provider does 1-5 above for http/https. Another example of an impl of IRemoteFileSystemBrowser is the local file system provider...i.e. urls that start with 'file:'...and that's in org.eclipse.ecf.provider.filetransfer.browse.LocalFileSystemBrowser.

Anyway, please open an enhancement request and I expect we can jointly implement this addition to the scp provider quickly and easily...assuming the com.jcraft.jsch library provides the necessary support for browsing the remote file system (as I believe it does, but haven't looked at in a while).

Scott