How dose the Nutch-0.9 read the configuration file?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

How dose the Nutch-0.9 read the configuration file?

Xin Zhang-2
Hello,

I want to develop a plugin, but I don't know the nutch-0.9 how to read the
configuration file. So I can't debug my plugin.

Thanks.
Reply | Threaded
Open this post in threaded view
|

Re: How dose the Nutch-0.9 read the configuration file?

Tranquil
if you want to read a new value from the nutch-default.xml file:

add a new entry in the xml, for e.g.:

<property>
  <name>parseexe.download.dir</name>
  <value>/home/eyale/HTTPSEC/nutch-0.9/DOWNLOADS/</value>
  <description> Download dir for file types nutch downloads while crawling.
  </description>
</property>

to read this from the code: (this code is from a parse-exe plugin i've
written).
the line in red is what needed.

// DOWNLOAD_DIR is a string var i've defined in the class.

 public void setConf(Configuration conf) {
    this.conf = conf;
    DOWNLOAD_DIR = getConf().get("parseexe.download.dir");
  }

there might be a naming convention for the att name, but i'm not fully aware
what it is..

hope this helps.

Eyal.



On 11/4/07, Xin Zhang <[hidden email]> wrote:
>
> Hello,
>
> I want to develop a plugin, but I don't know the nutch-0.9 how to read the
> configuration file. So I can't debug my plugin.
>
> Thanks.
>



--
Eyal Edri