You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@nutch.apache.org by Xin Zhang <nu...@gmail.com> on 2007/11/04 12:30:18 UTC
How dose the Nutch-0.9 read the configuration file?
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.
Re: How dose the Nutch-0.9 read the configuration file?
Posted by eyal edri <ey...@gmail.com>.
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 <nu...@gmail.com> 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