Commit 550c47c6 authored by Marco Konersmann's avatar Marco Konersmann

minor improvement of Models loading behaviour

parent 87e55ebd
......@@ -51,18 +51,14 @@ public class Models {
final ResourceSet resSet = new ResourceSetImpl();
final URI uri = URI.createPlatformResourceURI(fileName, true);
final Resource resource = resSet.createResource(uri);
boolean loadable = false;
try {
resource.load(Collections.EMPTY_MAP);
loadable = true;
return resource.getContents();
} catch (final IOException e) {
// Could not find a method like isLoadable
}
if (loadable) {
return resource.getContents();
} else
log.error("Could not load the file "+fileName, e);
return null;
}
}
@SuppressWarnings("unchecked")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment