tika-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kbennett <kbenn...@bbsinc.biz>
Subject TestParser Fails to Find config.xml
Date Mon, 10 Sep 2007 21:38:57 GMT

I'm getting an error when running the TestParsers test.  The test appears to
look for the XML configuration file in the first directory in the class
path, which, in my case, is in the Java home directory tree:


TestParsers.setUp() contains the following code:

String sep = File.separator;
StringTokenizer st = new StringTokenizer(System.getProperty(
        "java.class.path"), File.pathSeparator);

classDir = new File(st.nextToken());

config = classDir.getParent() + sep + "config" + sep + "config.xml";

Is there another way we can specify the location of the config.xml file that
would be more reliable?  Maybe by the following?:

URL configUrl = this.getClass().getResource("/config.xml");

I noticed there is already a config.xml in src/main/resources, which is
where it should be for the getResource() call above to work.

Then, we'd also need to change:

LiusConfig getInstance(String configFile)
LiusConfig getInstance(URL configUrl)

- Keith

View this message in context: http://www.nabble.com/TestParser-Fails-to-Find-config.xml-tf4418767.html#a12603579
Sent from the Apache Tika - Development mailing list archive at Nabble.com.

View raw message