I'm loading applications dynamically from a jar file and I'd really
like to attach a
Directory instance give a class instance. That is, something like:
router.attach("/content",new
Directory(getContext(),LocalReference.createClassReference(MyApp.class,"content"));
where the resource path is constructed as:
Class.getName()+"/" + path
so that in the above example, if the package of MyApp was "org.example":
"org/example/content"
and then the directory instance would load content via the ClassLoader
associated
with the class instance.
It may be the case that "Directory" is the wrong thing here.
Maybe we need a new Finder called ClassResourceFinder such that you can do:
router.attach("/content",new ClassResourceFinder(MyApp.clas,"content"));
and get resources from getResource() calls against the ClassLoader.
--Alex Milowski