Refreshing EMF resources through a byte[] [message #1220709] |
Fri, 13 December 2013 08:54 |
Andreas Maier Messages: 4 Registered: September 2013 |
Junior Member |
|
|
Hello everybody,
I'm having a problem refreshing/overwriting an emf resource. I have a graphiti editor for editing an emf model. The emf resources are saved to a server, that doesn't know about emf or anything, so I upload the resource as byte[] and I download the resource as byte[].
The upload case is no problem. Works as expected. The download case not so much. I try so set the new contents via
resource.delete(null);
resourceSet.createResource(URI.createPlatformResourceURI(modelFile.getLocationURI().toString(), true), <id-of-the-content-type>);
Files.write(Paths.get(modelFile.getLocationURI()), serverContent);
That also seems to work (the contents are written to the file), but the graphiti editor then tells me, that I have a file conflict. Is there a better way to overwrite the contents via byte[] or to suppress that file conflict dialog?
Any hints are welcome
Thanks in advance!
Best,
Andreas
|
|
|
Re: Refreshing EMF resources through a byte[] [message #1220730 is a reply to message #1220709] |
Fri, 13 December 2013 10:14 |
Ed Willink Messages: 7669 Registered: July 2009 |
Senior Member |
|
|
Hi
You don't say which Files you use, but I would recommend
IFile.setContent so that Eclipse knows what's happening.
Regards
Ed Willink
On 13/12/2013 08:54, Andreas Maier wrote:
> Hello everybody,
>
> I'm having a problem refreshing/overwriting an emf resource. I have a
> graphiti editor for editing an emf model. The emf resources are saved
> to a server, that doesn't know about emf or anything, so I upload the
> resource as byte[] and I download the resource as byte[].
> The upload case is no problem. Works as expected. The download case
> not so much. I try so set the new contents via
> resource.delete(null);
> resourceSet.createResource(URI.createPlatformResourceURI(modelFile.getLocationURI().toString(),
> true), <id-of-the-content-type>);
> Files.write(Paths.get(modelFile.getLocationURI()), serverContent);
>
> That also seems to work (the contents are written to the file), but
> the graphiti editor then tells me, that I have a file conflict. Is
> there a better way to overwrite the contents via byte[] or to suppress
> that file conflict dialog?
> Any hints are welcome :)
> Thanks in advance!
>
> Best,
> Andreas
|
|
|
|
Powered by
FUDForum. Page generated in 0.03406 seconds