Resource.Factory.Registry reg = Resource.Factory.Registry.INSTANCE;
Map<String, Object> m = reg.getExtensionToFactoryMap();
m.put("xml", new XMIResourceFactoryImpl());
// Obtain a new resource set
FlowConnectorResourceImpl resource = new FlowConnectorResourceImpl(URI
.createURI("website/My1.xml"));
resource.setEncoding("UTF-8");
resource.getContents().add(flowConnectorDefinition);
try {
resource.save(Collections.EMPTY_MAP);
} catch (IOException e) {
e.printStackTrace();
}
//resource.getDefaultSaveOptions().put(XMLResource.OPTION_KEEP_DEFAULT_CONTENT, Boolean.TRUE);
// Now save the content.
try {
resource.save(Collections.EMPTY_MAP);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
//load();