Creating a Resource from files in InMemoryFileSystemAccess [message #1803929] |
Wed, 13 March 2019 14:51  |
Eclipse User |
|
|
|
Normally, it is possible to create a Resource from a file defined in the file system like this:
URI uri = URI.createFileURI(f.getAbsolutePath());
resourceSet.getResource(uri, true);
How can I achieve the same thing using the InMemoryFileSystemAccess
If I pass a URI using that, I get a bad URI exception?
Map<String, Object> files = fileAccess.getAllFiles();
ResourceSet resourceSet = new ResourceSetImpl();
URI uri = fileAccess.getURI("path/to/file.ext", "DefaultOutputConfig");
resourceSet.getResource(uri, true); //here I get a bad URI Exception
|
|
|
|
|
|
|
|
|
|
Re: Creating a Resource from files in InMemoryFileSystemAccess [message #1804500 is a reply to message #1803951] |
Wed, 27 March 2019 05:27  |
Eclipse User |
|
|
|
Hi Christian
Thank you for your replies.
We have currently solved this issue.
The use case was to test if the generators are generating the expected output.
Due to Project Constraints, I could not use the inMemoryFileSystemAccess. I solved the issue by using the TemporaryFolder Framework from JUNIT, i.e. run generators and the output files will be generated in a temporary folder. Then I compare them with the expected output.
However, your replies are very informative and will certainly come in handy for future problems.
Thanks again!
[Updated on: Wed, 27 March 2019 05:28] by Moderator
|
|
|
Powered by
FUDForum. Page generated in 0.03687 seconds