Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community Forumscreating Resource
https://www.eclipse.org/forums/index.php/mv/msg/195711/623669/#msg_623669
I want to do something like the following to save a model:
private static void saveModel(String name, Model model) {
String filename = outDir + name + "." + UMLResource.FILE_EXTENSION;
File file = new File(filename);
URI uri = URI.createFileURI(file.getAbsolutePath());
ResourceSet resourceSet = new ResourceSetImpl();
resourceSet.setResourceFactoryRegistry(Registry.INSTANCE);
// problem on following line
Resource resource = resourceSet.createResource(uri);
but I have a problem on the marked line when creating the Resource. I
always get null. The Javadoc says that null is be returned when no
factory is registered. But I do register my factory(the standard one)
one line before, don't I? So where is my problem? Or better - what is
wrong in my code?