costin      01/07/15 17:01:43

  Modified:    src/share/org/apache/tomcat/modules/config AutoWebApp.java
  Log:
  AutoWebApp ( the one that adds apps from a dir ) can now set the trusted
  flag and a profile on all apps loaded from that particular dir.
  
  Revision  Changes    Path
  1.6       +26 -1     
jakarta-tomcat/src/share/org/apache/tomcat/modules/config/AutoWebApp.java
  
  Index: AutoWebApp.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/modules/config/AutoWebApp.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- AutoWebApp.java   2001/06/20 05:55:06     1.5
  +++ AutoWebApp.java   2001/07/16 00:01:42     1.6
  @@ -86,7 +86,9 @@
       String defaultHost=null; 
       boolean flat=true;
       boolean ignoreDot=true;
  -
  +    String profile=null;
  +    boolean trusted=false;
  +    
       // encoding scheme - XXX review, customize, implement
       char hostSeparator='@'; // if support for vhost configuration is enabled
       // instead of one-dir-per-host, this char will separate the host part.
  @@ -132,6 +134,24 @@
       public void setFlat( boolean b ) {
        flat=b;
       }
  +
  +    /** Set the "profile" attribute on each context. This
  +     can be used by a profile module to configure the
  +     context with special settings.
  +    */
  +    public void setProfile( String s ) {
  +     profile=s;
  +    }
  +
  +    /** Set the trusted attribute to all apps. This is
  +     used for "internal" apps, to reduce the number 
  +     of manual configurations. It works by creating
  +     a special directory and using <AutoWebApp> to
  +     add all the apps inside with a trusted attribute.
  +    */
  +    public void setTrusted( boolean b ) {
  +     trusted=b;
  +    }
       
       //-------------------- Implementation --------------------
       
  @@ -240,6 +260,11 @@
                ctx.setDocBase( dir.getAbsolutePath());
            }
   
  +         if( trusted ) 
  +             ctx.setTrusted( true );
  +         if( profile!=null )
  +             ctx.setProperty( "profile", profile );
  +         
            if( debug > 0 )
                log("automatic add " + host + ":" + ctx.toString() + " " +
                    path);
  
  
  

Reply via email to