Skip to main content



      Home
Home » Modeling » EMF » [EMF-URI] Copy folder's contents through URIs
[EMF-URI] Copy folder's contents through URIs [message #654337] Tue, 15 February 2011 04:20 Go to next message
Eclipse UserFriend
Hello,

Here is my problem : I have a model, provided by a plug-in through an extension point. I'd like to be able to make changes to this model at runtime, so I tried to copy it. The problem is that this model may have many dependencies, and I'd like to copy these dependencies as well.

There are two kinds of dependencies : Absolute URIs, which I don't wish to copy, and Relative URIs, which I'm interested in.

The problem is that I can't list the folder's contents, as it cannot be converted to a java.io.File (It is a platform:/plugin/... URI, which isn't a file)

Is there a way to do this copy ? I considered loading the whole ResourceSet (To load all dependencies), then filter the resources I'm interested in, but it seems very expensive, compared to a simple folder copy. Moreover, I don't know how to load the whole ResourceSet.

Any pointer would be really appreciated Smile

Thank you,


Camille Letavernier
Re: [EMF-URI] Copy folder's contents through URIs [message #654346 is a reply to message #654337] Tue, 15 February 2011 05:20 Go to previous messageGo to next message
Eclipse UserFriend
Camille,

Comments below.

Camille Letavernier wrote:
> Hello,
>
> Here is my problem : I have a model, provided by a plug-in through an
> extension point. I'd like to be able to make changes to this model at
> runtime, so I tried to copy it. The problem is that this model may
> have many dependencies, and I'd like to copy these dependencies as well.
>
> There are two kinds of dependencies : Absolute URIs, which I don't
> wish to copy, and Relative URIs, which I'm interested in.
>
> The problem is that I can't list the folder's contents, as it cannot
> be converted to a java.io.File (It is a platform:/plugin/... URI,
> which isn't a file)
You could use FileLocator.toFileURI; be warned it will unpack jars to
create a copy.
>
> Is there a way to do this copy ? I considered loading the whole
> ResourceSet (To load all dependencies),
EcoreUtil.resolveAll can help with that.
> then filter the resources I'm interested in, but it seems very
> expensive, compared to a simple folder copy.
I wonder though how much performance is really a concern in the end...
> Moreover, I don't know how to load the whole ResourceSet.
EcoreUtil.resolveAll will help.
>
> Any pointer would be really appreciated :)
>
> Thank you,
>
>
> Camille Letavernier
Re: [EMF-URI] Copy folder's contents through URIs [message #654395 is a reply to message #654337] Tue, 15 February 2011 10:04 Go to previous message
Eclipse UserFriend
Thank you for your answers !

Quote:
I wonder though how much performance is really a concern in the end...


Well, it's an interactive operation, so the faster, the better Smile But as long as there is a progress bar, it is not a real problem.

I will try both solutions, and see which one is best in my case. Thanks again.


Camille Letavernier
Previous Topic:Re: CDO Repository Server Reconnect Failure
Next Topic:Resolved proxy
Goto Forum:
  


Current Time: Wed Jul 23 16:01:03 EDT 2025

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

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

Back to the top