nacho       01/02/01 17:27:42

  Modified:    src/share/org/apache/tomcat/modules/config
                        ServerXmlReader.java WebAppsConfig.java
  Log:
  Portability issues.
  
  Revision  Changes    Path
  1.2       +12 -13    
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.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ServerXmlReader.java      2001/02/01 06:22:08     1.1
  +++ ServerXmlReader.java      2001/02/02 01:27:42     1.2
  @@ -124,21 +124,20 @@
        if (configFile == null)
            configFile=DEFAULT_CONFIG;
   
  -     if( configFile.startsWith( "/" ) ) 
  -         f=new File(configFile);
  -     else
  -         f=new File( cm.getHome(), "/" + configFile);
  +        f=new File(configFile);
  +        if ( !f.isAbsolute())
  +         f=new File( cm.getHome(), File.separator + configFile);
   
  -     if( f.exists() )
  +     if( f.exists() ){
            loadConfigFile(xh,f,cm);
  -
  -     // load server-*.xml
  -     Vector v = getUserConfigFiles(f);
  -     for (Enumeration e = v.elements();
  -          e.hasMoreElements() ; ) {
  -         f = (File)e.nextElement();
  -         loadConfigFile(xh,f,cm);
  -     }
  +            // load server-*.xml
  +            Vector v = getUserConfigFiles(f);
  +            for (Enumeration e = v.elements();
  +                 e.hasMoreElements() ; ) {
  +                f = (File)e.nextElement();
  +                loadConfigFile(xh,f,cm);
  +            }
  +        }
       }
   
       // -------------------- Xml reading details --------------------
  
  
  
  1.5       +7 -9      
jakarta-tomcat/src/share/org/apache/tomcat/modules/config/WebAppsConfig.java
  
  Index: WebAppsConfig.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/modules/config/WebAppsConfig.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- WebAppsConfig.java        2000/12/30 08:26:44     1.4
  +++ WebAppsConfig.java        2001/02/02 01:27:42     1.5
  @@ -94,22 +94,20 @@
       }
   
       //-------------------- Implementation --------------------
  -    
  -    /** 
  +
  +    /**
        */
       public void engineInit(ContextManager cm) throws TomcatException {
        Enumeration loadedCtx=cm.getContexts();
        while( loadedCtx.hasMoreElements() ) {
            addExistingCtx( (Context)loadedCtx.nextElement());
        }
  -     
  +
        String home=cm.getHome();
  -     File webappD;
  -     
  -     if( hostsD.startsWith( "/" ) ) 
  -         webappD=new File(hostsD);
  -     else
  -         webappD=new File(home + "/" + hostsD);
  +     File webappD=new File(hostsD);
  +
  +     if( ! webappD.isAbsolute() )
  +         webappD=new File(home + File.separator + hostsD);
        
        if (! webappD.exists() || ! webappD.isDirectory()) {
            log("No autoconf directory " + webappD );
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]

Reply via email to