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:

/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home/lib/config/config.xml

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)
to
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.


Mime
View raw message