Xtext error: Registered resource factory is needed
eclipse, java, uri, xtext
Solution
I guess that the D: is interpreted as a scheme. Try using 'URI.createFileURI()' instead.
Problem
I have an application that accepts a file as an input. Since the files are located in different location, the path will be relative to the .jar location. Example: D:\Test\JAVA_App\Exe is where that tester.jar is placed. So when ran in the windows command line, I do this: tester.jar D:\Test\JAVA_App\Exe....\testcase1.txt To process the file, my code is calling ResourceSet from org.eclipse.emf.ecore.resource.ResourceSet. This is the code I have: ``` ResourceSet set = resourceSetProvider.get() Resource resource = set.getResource(URI.createURI(<inputted path of file>)) ``` I found out that the "registered resource factory is needed" error is not caused by an incorrect path (I can open it if I run the whole path in the commandline), but because of the "..\" in between. If I use "....\testcase1.txt" only, it works fine. But if it has the "D:\" in the beginning with "..\" in between, the error occurs. Is there another way to use "D:\Test\JAVA_App\Exe....\testcase1.txt" in xtext?