Skip to content
Snippets Groups Projects
Commit 49ab2099 authored by Mick Jordan's avatar Mick Jordan
Browse files

use ResourceHandlerFactory in RInternalCode

parent ac0d9f87
Branches
No related tags found
No related merge requests found
......@@ -55,11 +55,14 @@ public final class RInternalCode {
}
public static Source loadSourceRelativeTo(Class<?> clazz, String fileName) {
URL url = clazz.getResource("/" + clazz.getPackage().getName().replaceAll("\\.", "//") + "/" + fileName);
try {
URL url = ResourceHandlerFactory.getHandler().getResource(clazz, fileName);
if (url == null) {
throw new IOException();
}
return Source.fromURL(url, fileName);
} catch (IOException e) {
throw RInternalError.shouldNotReachHere(e, "Internal R script failed to load.");
throw RInternalError.shouldNotReachHere(e, "Internal R script " + fileName + " failed to load.");
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment