Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Eclipse Communications Framework (ECF) » how to ask ECF is scheme is supported for file transfer
how to ask ECF is scheme is supported for file transfer [message #624773] Thu, 16 April 2009 02:26 Go to next message
Henrik Lindberg is currently offline Henrik LindbergFriend
Messages: 2509
Registered: July 2009
Senior Member
Hi,
I have a URI (as entered by a user in a UI), and I want to know if the
current configuration of ECF has support for filetransfer using the scheme.

How should I perform the check?

Regards
- henrik
Re: how to ask ECF is scheme is supported for file transfer [message #624778 is a reply to message #624773] Thu, 16 April 2009 03:33 Go to previous message
Scott Lewis is currently offline Scott LewisFriend
Messages: 1038
Registered: July 2009
Senior Member
Hi Henrik,

I know this isn't very satisfactory, but one way would be to create an
URL and see if it throws a MalformedURLException. If it does, then the
scheme is not supported.

Another way to examine what schemes are supported is to consult the
service registry for all services that implement this interface:

org.osgi.service.url.URLStreamHandlerService

In the service property with name:

org.osgi.service.url.URLConstants.URL_HANDLER_PROTOCOL

The value of this service property is a String[] with the protocols
supported by this URLStreamHandlerService. As ECF file transfer
providers are added, if they are not already registered as an
URLStreamHandlerService, then ECF registers the new scheme on startup
with this code (in org.eclipse.ecf.provider.filetransfer bundle
Activator class line 650:

final Hashtable properties = new Hashtable();
properties.put(URLConstants.URL_HANDLER_PROTOCOL, new String[] {protocol});

We would like to eventually add an interface for such introspection
(e.g. on IRetrieveFileTransferContainerAdapter,
IBrowseFileTransferContainerAdapter, and
ISendFileTransferContainerAdapter) but have not had the opportunity to
do so. So an enhancement request to this end would be most appreciated.

Thanks,

Scott



Henrik Lindberg wrote:
> Hi,
> I have a URI (as entered by a user in a UI), and I want to know if the
> current configuration of ECF has support for filetransfer using the scheme.
>
> How should I perform the check?
>
> Regards
> - henrik
Previous Topic:Re: using tcp as rcp client and server protocol?
Next Topic:File Types Natively Supported for Shared Editing
Goto Forum:
  


Current Time: Fri Apr 26 05:11:55 GMT 2024

Powered by FUDForum. Page generated in 0.02777 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top