Resource.Factory.Registry reg = Resource.Factory.Registry.INSTANCE;
Map<String, Object> m = reg.getExtensionToFactoryMap();
m.put("ifg", new XMIResourceFactoryImpl());
// Obtain a new resource set
ResourceSet resSet = new ResourceSetImpl();
//load the Resource
//URI ifgURI1 = URI.createURI(this.getClass().getResource(IFG_FILE).toURI().getPath());
URI ifgURI2 = URI.createURI(new File(IFG_FILE_ABSOLUT_PATH).getAbsolutePath());
Resource ifgResource = resSet.getResource(ifgURI2, true);
IWorkspace ws = ResourcesPlugin.getWorkspace();
IProject project = ws.getRoot().getProject("res");
if (!project.exists())
project.create(null);
if (!project.isOpen())
project.open(null);
IPath location = new Path(IFG_FILE_ABSOLUT_PATH);
IFile iFile = project.getFile(location.lastSegment());
iFile.createLink(location, IResource.NONE, null);
public static InputStream createPlatformResourceInputStream(String platformResourcePath, Map<?, ?> options) throws IOException