nutch-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "eyal edri" <eyal.e...@gmail.com>
Subject Re: How dose the Nutch-0.9 read the configuration file?
Date Sun, 04 Nov 2007 12:23:21 GMT
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 <nutch.xin@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

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message