Classpath is used as it's the only way I know in Java to refer to the installation location. (One can use the "java.home" system property to find the location of the java installation, but not the location of application code.) Also, things on classpath are generally easier for servlets and applets to access than arbitrary files. Finally, using classpath means that config files can easily be bundled into jar files with code.

That said, it might be useful to also check an environment variable. We could check, e.g., NUTCH_CONF_DIR, if defined, before the classpath.

Doug

sub paul wrote:
Hi all,

I was trying to find a way to load NutchConf by specifying the exact
location of the conf files. Is there a way to load the NutchConf
without actually adding the conf files to the classpath? I looked at
the api doc and I does not seem to have a way to do that.

I am thinking extending NutchConf and overriding  public URL
getResource(String name);

would that be a pretty good way of going about it?

Also, does anyone see a need a case where we need to load conf files
that are not on classpath?

Regards,
Paul

Reply via email to