Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » EMF resource how to flush to disk
EMF resource how to flush to disk [message #967067] Thu, 01 November 2012 13:10 Go to next message
Mat Mathiew is currently offline Mat MathiewFriend
Messages: 29
Registered: July 2012
Junior Member
I create a new EMF resource:

Resource res = new XMLResourceImpl(uri);

and then I copy the conttents of another resource:
res.getContents().add(
	EcoreUtil.copy(contentsOfAnotherResource);


and then i save the first one:

res.save(Collections.EMPTY_MAP)



The problem is that the contents are not flushed to disk, only for example if
I repeat the operation the contents of the first operation will be flushed.
Is theere any way to flush them ? Maybe will some save options that I couldnt find?

[Updated on: Thu, 01 November 2012 13:14]

Report message to a moderator

Re: EMF resource how to flush to disk [message #967171 is a reply to message #967067] Thu, 01 November 2012 14:51 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33113
Registered: July 2009
Senior Member
Matt,

I expect an input stream to be created, written to, and then closed
during the save process; you can use the debugger to confirm that. There
should be no need for flushing anything. Once the stream is closed,
there's nothing else possible to do with it. What OS are you on? What
uri are you using?


On 01/11/2012 2:10 PM, Mat Mathiew wrote:
> I create a new EMF resource:
>
> Resource res = new XMLResourceImpl(uri);
> and then I copy the conttents of another resource:
>
> res.getContents().add(
> EcoreUtil.copy(contentsOfAnotherResource);
>
> and then i save the first one:
>
> res.save(Collections.EMPTY_MAP)
>
>
> The problem is that the contents are not flushed to disk, only for
> example if
> I repeat the operation the contents of the first operation will be
> flushed.
> Is theere any way to flush them ? Maybe will some save options that I
> couldnt find?


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:Reading attribute value from EObject programmatically
Next Topic:XML (Structured) Text editor synchronized with EMF view
Goto Forum:
  


Current Time: Thu Mar 28 15:17:39 GMT 2024

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

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

Back to the top