[EMF-URI] Copy folder's contents through URIs [message #654337] |
Tue, 15 February 2011 09:20 |
Camille Letavernier 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
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 |
Ed Merks 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/
|
|
|
|
Powered by
FUDForum. Page generated in 0.03254 seconds