On Sat, 12 Jul 2003 00:27:16 -0400, Vadim Gritsenko wrote:
> Hi guys,
>
> One more issue when trying to use embedded driver from command line tool.
> It always tries to prepend user.dir to the path to the config.xml file.
> When path to the config.xml is absolute this is becoming ugly.
>
> Propsed patch - check for absolute paths. Hope it gets applied.
>
> PS I don't know why user.dir is appended in the first place; I would
> remove this completely.
Becuase on my unix system I want the default directory to be /home/<user>/
rather than /. This is a good thing. Each user gets their own data store
unless they override (and the directories they talk to have the correct
permissions).
> VadimIndex: java/src/org/apache/xindice/tools/XMLTools.java
> =================================================================== RCS
> file:
> /home/cvspublic/xml-xindice/java/src/org/apache/xindice/tools/XMLTools.java,v
> retrieving revision 1.16
> diff -u -r1.16 XMLTools.java
> --- java/src/org/apache/xindice/tools/XMLTools.java 12 Dec 2002 20:51:19
> -0000 1.16 +++ java/src/org/apache/xindice/tools/XMLTools.java 12 Jul
> 2003
> 04:23:29 -0000 @@ -277,9 +277,12 @@
> } else if ( token.equalsIgnoreCase("-l") ||
> } token.equalsIgnoreCase("--localdb") ) {
> table.put( LOCAL, "true");
> } else if ( token.equalsIgnoreCase("-d") ||
> } token.equalsIgnoreCase("--dbconfig") ) {
> - String configFile = System.getProperty("user.dir") +
> File.separator + at.nextSwitchToken(); -
> System.setProperty(Xindice.PROP_XINDICE_CONFIGURATION, configFile); -
> table.put( DB_CONFIG, configFile); + String configFile =
> at.nextSwitchToken(); + if (!new
> File(configFile).isAbsolute()) { + configFile = new
> File(System.getProperty("user.dir"), configFile).getAbsolutePath(); +
> }
> + System.setProperty(Xindice.PROP_XINDICE_CONFIGURATION,
> configFile); + table.put(DB_CONFIG, configFile);
> } else if ( token.equalsIgnoreCase("-s") ||
> } token.equalsIgnoreCase("--namespaces") ) {
> table.put(NAMESPACES, at.nextSwitchToken());
> // Index specific options