Errors in RegexURLFilter

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

Errors in RegexURLFilter

scott green
Hi

Here is the main methond in RegexURLFilter,
  public static void main(String args[]) throws IOException {
    main(new RegexURLFilter(), args);
  }

the empty RegexURLFilter() cotor will not load rules at all. So the
main method should be run failed. It shoule be
  public static void main(String args[]) throws IOException {
     RegexURLFilter filter = new RegexURLFilter();
     filter.setConf(NutchConfiguration.create());
     main(filter, args);
  }

right?
And i also did not find setConf() before filter() in URLFilters. I
wonder where the rules are loaded from. Thanks

- scott
Reply | Threaded
Open this post in threaded view
|

Re: Errors in RegexURLFilter

Sami Siren-2
scott green wrote:

> Hi
>
> Here is the main methond in RegexURLFilter,
>  public static void main(String args[]) throws IOException {
>    main(new RegexURLFilter(), args);
>  }
>
> the empty RegexURLFilter() cotor will not load rules at all. So the
> main method should be run failed. It shoule be
>  public static void main(String args[]) throws IOException {
>     RegexURLFilter filter = new RegexURLFilter();
>     filter.setConf(NutchConfiguration.create());
>     main(filter, args);
>  }
>
Yes, looks like you're right.
> right?
> And i also did not find setConf() before filter() in URLFilters. I
> wonder where the rules are loaded from. Thanks
This is done for all plugins implementing Configurable interface in
org.apache.nutch.plugin.Extension at line #162.

--
 Sami Siren
Reply | Threaded
Open this post in threaded view
|

Re: Errors in RegexURLFilter

scott green
On 11/21/06, Sami Siren <[hidden email]> wrote:

> scott green wrote:
> > Hi
> >
> > Here is the main methond in RegexURLFilter,
> >  public static void main(String args[]) throws IOException {
> >    main(new RegexURLFilter(), args);
> >  }
> >
> > the empty RegexURLFilter() cotor will not load rules at all. So the
> > main method should be run failed. It shoule be
> >  public static void main(String args[]) throws IOException {
> >     RegexURLFilter filter = new RegexURLFilter();
> >     filter.setConf(NutchConfiguration.create());
> >     main(filter, args);
> >  }
> >
> Yes, looks like you're right.
> > right?
> > And i also did not find setConf() before filter() in URLFilters. I
> > wonder where the rules are loaded from. Thanks
> This is done for all plugins implementing Configurable interface in
> org.apache.nutch.plugin.Extension at line #162.

Thanks, i got it :)

> --
>  Sami Siren
>