Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » How to delete a Resource programatically in EMF
How to delete a Resource programatically in EMF [message #411282] Fri, 20 July 2007 13:15 Go to next message
Eclipse UserFriend
Originally posted by: andrew_steady.hotmail.com

Hi,

How can I programatically delete a resource in EMF?

There is only one EObject inside it which is contained by a an EObject in
another Resource.

Any ideas much appreciated,

Andy
Re: How to delete a Resource programatically in EMF [message #411283 is a reply to message #411282] Fri, 20 July 2007 13:40 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33217
Registered: July 2009
Senior Member
Andy,

EcoreUtil.delete can be used to remove all references to an object. A
resource can just be removed from a resource set. There's no facility
for deleting the actual file in the backing store. I'm hoping to add
such a thing in EMF 2.4 as part of the effort to generalize the
URIConverter to support a full REST-style URI access (that includes
delete, exists, timestamps, and hopefully a read only test).


Andrew Steady wrote:
> Hi,
>
> How can I programatically delete a resource in EMF?
>
> There is only one EObject inside it which is contained by a an EObject
> in another Resource.
>
> Any ideas much appreciated,
>
> Andy


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: How to delete a Resource programatically in EMF [message #411284 is a reply to message #411283] Fri, 20 July 2007 13:50 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: andrew_steady.hotmail.com

Hi,

Thanks, can you see any problem with manually deleting the file once we've
removed all references and removed the resource from the resourceset?

Cheers,

Andy
Re: How to delete a Resource programatically in EMF [message #411290 is a reply to message #411284] Fri, 20 July 2007 14:25 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33217
Registered: July 2009
Senior Member
Andy,

I don't foresee any problems, no.


Andrew Steady wrote:
> Hi,
>
> Thanks, can you see any problem with manually deleting the file once
> we've removed all references and removed the resource from the
> resourceset?
>
> Cheers,
>
> Andy
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:equality of DynamicEObjects
Next Topic:XRefs to registered packages
Goto Forum:
  


Current Time: Mon Sep 23 14:21:22 GMT 2024

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

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

Back to the top