Java Mailing List Archive

http://www.java2.5341.com/

Home » nutch-user.lucene »

Access external resource in plugin

Julien Nioche

2008-09-23

Replies: Find Java Web Hosting

Author LoginPost Reply
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
©2008 java2.5341.com - Jax Systems, LLC, U.S.A.