Skip to content

Instantly share code, notes, and snippets.

@nbhusare
Created May 1, 2019 10:35
Show Gist options
  • Save nbhusare/a00a67bae814b48d740290359ba8f124 to your computer and use it in GitHub Desktop.
Save nbhusare/a00a67bae814b48d740290359ba8f124 to your computer and use it in GitHub Desktop.
EMF URI Convertor - Storing and converting URI's from one format to another
final URIConverter converter = new URIConverterImpl();
final URI uri1 = URI.createURI("http://www.example.com/epo2.ecore");
final URI uri2 = URI.createURI("platform:/resource/models/epo2.ecore");
// Maintain mapping between the two URI's
converter.getURIMap().put(uri1, uri2);
// Normalize/Convert the URI from one format into another
final URI normalized = converter.normalize(uri1);
System.out.println(normalized);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment