Julien Nioche wrote:
I had actually taken *http://wiki.apache.org/nutch/GeoPosition* as an example; after a bit more digging it appears that * conf.getResource() *returns a resource located in the main */conf* directory (i.e the one with nutch-site etc...) - not the one located in my plugin directory. That seems
Actually, this is more complicated. In the development environment, conf/ is prepended to classpath, so indeed this resource is looked up there. The build process also takes these resources from conf/ and adds them to nutch*.jar, placing them in the root dir inside the jar. If you execute Nutch using just the nutch*.job, then these copies are looked up.
to work fine, however I was wondering if there was a way of doing the same but accessing the resource from the plugin directory instead.
How about YourPlugin.class.getResourceAsStream("model") ? This should look up the resource first from the root of your class loader (which is the root dir inside your plugin jar), and then try its parent classloader, which loads the resource from nutch.job jar.
-- Best regards, Andrzej Bialecki <>< ___. ___ ___ ___ _ _ __________________________________ [__ || __|__/|__||\/| Information Retrieval, Semantic Web ___|||__|| \| || | Embedded Unix, System Integration http://www.sigram.com Contact: info at sigram dot com
