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
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.

J.


2008/9/23 Julien Nioche <[EMAIL PROTECTED]>

> Hi,
>
> I am working on a plugin which requires an external resource (a statistical
> model) and am wondering whether there is a standard way of organising the
> plugin for that. I had a look at the existing plugins but can't find
> anything related.
>
> From an access point of view I assume that :
>
> *    public void setConf(Configuration conf) {
>         this.conf = conf;
>         // initialise the text classifier
>         try {
>             URL classifFileURL = conf.getResource("model");
>             File classifFile = new File(classifFileURL.getFile());
>             classifier = TextClassifier.getClassifier(classifFile);
>         } catch (Exception e) {
>             e.printStackTrace();
>         }
>     }
>   *
> would work given that there is a directory *model* located in the
> subdirectory conf of my plugin. Is there a better way to do that?
>
> my other problem is that I can't find a way to copy my resources in the
> using build-plugin.xml (via the build.xml in my plugin directory). I don't
> really want to have to copy the directory manually, is there another way to
> do that without hacking *build-plugin.xml*?
>
> Thanks
>
> Julien
> --
> DigitalPebble Ltd
> http://www.digitalpebble.com
>



-- 
DigitalPebble Ltd
http://www.digitalpebble.com

Reply via email to