tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From na...@locus.apache.org
Subject cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/context AutoSetup.java
Date Wed, 05 Jul 2000 19:22:54 GMT
nacho       00/07/05 12:22:53

  Modified:    src/share/org/apache/tomcat/context AutoSetup.java
  Log:
  Autosetup tries to setup ALL the files in the webapps directory
  including normal files, now only try to autosetup directories
  
  Revision  Changes    Path
  1.14      +22 -17    jakarta-tomcat/src/share/org/apache/tomcat/context/AutoSetup.java
  
  Index: AutoSetup.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/context/AutoSetup.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- AutoSetup.java	2000/06/23 02:16:16	1.13
  +++ AutoSetup.java	2000/07/05 19:22:52	1.14
  @@ -141,12 +141,12 @@
   		// we will add the directory to the path
   		name=fname;
   	    }
  -	    
  +
   	    // XXX XXX Add a .xml case
   	    // If a "path.xml" file is found in webapps/, it will be loaded
   	    // as a <context> fragment ( what will allow setting options
   	    // for contexts or automatic config for contexts with different base)
  -	    
  +
   	    // Decode path
   
   	    // Path will be based on the War name
  @@ -155,22 +155,27 @@
   	    String path="/" + name; // decode(name)
   	    //	    System.out.println("XXX : " + path );
   	    if( path.equals("/ROOT") )
  -		path="";
  -	    
  +		    path="";
  +
   	    if(  definedContexts.get(path) == null ) {
  -		// if no explicit set up
  -		Context ctx=new Context();
  -		ctx.setContextManager( cm );
  -		ctx.setPath(path);
  -		// use absolute filename based on CM home instead of relative
  -		// don't assume HOME==TOMCAT_HOME
  -		File f=new File( webappD, name);
  -		ctx.setDocBase( f.getAbsolutePath() );
  -		if( debug > 0 ) log("automatic add " + ctx.toString() + " " + path);
  -		cm.addContext(ctx);
  -	    } else {
  -		if( debug>0) log("Already set up: " + path + " " + definedContexts.get(path));
  -	    }
  +		    // if no explicit set up and is a directory
  +            File f=new File( webappD, name);
  +            if (f.isDirectory()) {
  +                Context ctx=new Context();
  +                ctx.setContextManager( cm );
  +                ctx.setPath(path);
  +                // use absolute filename based on CM home instead of relative
  +                // don't assume HOME==TOMCAT_HOME
  +                ctx.setDocBase( f.getAbsolutePath() );
  +                if( debug > 0 )
  +                    log("automatic add " + ctx.toString() + " " + path);
  +                cm.addContext(ctx);
  +            } else {
  +                if( debug>0)
  +                log("Already set up: " + path + " "
  +                        + definedContexts.get(path));
  +            }
  +            }
   	}
       }
   
  
  
  

Mime
View raw message