costin 01/07/16 20:38:18
Modified: src/share/org/apache/tomcat/modules/config
ServerXmlReader.java
Log:
Fix for #137 ( finally :-). That will make -f work as expected if relative
paths are used ( i.e. relative to the user dir, not tc.home ), and will
work for files in the current dir.
Revision Changes Path
1.12 +9 -6
jakarta-tomcat/src/share/org/apache/tomcat/modules/config/ServerXmlReader.java
Index: ServerXmlReader.java
===================================================================
RCS file:
/home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/modules/config/ServerXmlReader.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- ServerXmlReader.java 2001/07/16 00:05:04 1.11
+++ ServerXmlReader.java 2001/07/17 03:38:18 1.12
@@ -134,14 +134,17 @@
// load the config file(s)
File f = null;
- if (configFile == null)
- configFile=DEFAULT_CONFIG;
+ if (configFile == null) {
+ f=new File( cm.getHome(), DEFAULT_CONFIG);
+ } else {
+ // All other paths are relative to TOMCAT_HOME, except this one.
+ // The user will either type an absolute path or a path relative
+ // to his working dir ( relative to TOMCAT_HOME is counterintuitive)
+ f=new File(configFile);
+ }
- f=new File(configFile);
- if ( !f.isAbsolute())
- f=new File( cm.getHome(), File.separator + configFile);
-
if( f.exists() ){
+ f=new File( f.getAbsolutePath());
cm.setNote( "configFile", f.getAbsolutePath());
loadConfigFile(xh,f,cm);
String s=f.getAbsolutePath();