kevinross 2003/07/17 07:40:35
Modified: java/src/org/apache/xindice/tools XMLTools.java
Log:
PR: none
Submitted By: Vadim Gristenko ([EMAIL PROTECTED])
Reviewed By: Kevin Ross
Check for an absolute path before defaulting to prepending user.dir.
Revision Changes Path
1.17 +7 -4
xml-xindice/java/src/org/apache/xindice/tools/XMLTools.java
Index: XMLTools.java
===================================================================
RCS file:
/home/cvs/xml-xindice/java/src/org/apache/xindice/tools/XMLTools.java,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- XMLTools.java 12 Dec 2002 20:51:19 -0000 1.16
+++ XMLTools.java 17 Jul 2003 14:40:34 -0000 1.17
@@ -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