Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 09:20 Go to next message
Camille Letavernier is currently offline Camille LetavernierFriend
Messages: 952
Registered: February 2011
Senior Member
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


Camille Letavernier
Re: [EMF-URI] Copy folder's contents through URIs [message #654346 is a reply to message #654337] Tue, 15 February 2011 10:20 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33146
Registered: July 2009
Senior Member
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


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: [EMF-URI] Copy folder's contents through URIs [message #654395 is a reply to message #654337] Tue, 15 February 2011 15:04 Go to previous message
Camille Letavernier is currently offline Camille LetavernierFriend
Messages: 952
Registered: February 2011
Senior Member
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


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


Current Time: Thu May 09 20:52:41 GMT 2024

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

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

Back to the top