* .rb resource that is not expected to contribute anything to the pptp. All non null resources are added to the
* resource set.
*/
public Resource loadResource(InputStream in, URI uri) throws Exception {
// Lookup the factory to use for the resource
Factory factory = Resource.Factory.Registry.INSTANCE.getFactory(uri);
// // UGLY AS HELL HACK
// if(factory instanceof XtextResourceFactory)
// factory = injector.getInstance(XtextResourceFactory.class);
// Avoid loading lots of empty resources for rb files that do not
// contribute
if(factory instanceof PptpRubyResourceFactory && !pptpRubyResourceServiceProvider.canHandle(uri))
return null;
Map<String, String> options = Maps.newHashMap();
options.put(XtextResource.OPTION_ENCODING, getEncodingProvider().getEncoding(uri));
Resource r = factory.createResource(uri);
resourceSet.getResources().add(r);
r.load(in, options);
return r;
}