costin      01/06/16 13:19:23

  Modified:    src/share/org/apache/tomcat/modules/config WorkDirSetup.java
  Log:
  The workdir attribute is returned by the WorkDirInterceptor.
  
  Revision  Changes    Path
  1.6       +28 -0     
jakarta-tomcat/src/share/org/apache/tomcat/modules/config/WorkDirSetup.java
  
  Index: WorkDirSetup.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/modules/config/WorkDirSetup.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- WorkDirSetup.java 2001/04/22 05:38:52     1.5
  +++ WorkDirSetup.java 2001/06/16 20:19:23     1.6
  @@ -80,6 +80,12 @@
       String workdirBase=null;
       boolean useWebInf=false;
       boolean oldStyle=false;
  +    private int attributeInfo;
  +
  +    /** Workdir - a place where the servlets are allowed to write
  +     */
  +    public static final String ATTRIB_WORKDIR="javax.servlet.context.tempdir";
  +    // old: org.apache.tomcat.workdir
       
       public WorkDirSetup() {
       }
  @@ -115,6 +121,14 @@
       }
       
       // -------------------- Callbacks --------------------
  +
  +    public void engineInit( ContextManager cm )
  +     throws TomcatException
  +    {
  +     attributeInfo=cm.getNoteId(ContextManager.REQUEST_NOTE,
  +                                "req.attribute");
  +    }
  +
       
       public void addContext(ContextManager cm, Context ctx) {
        // not explicitely configured
  @@ -139,6 +153,20 @@
        }
       }
   
  +    public final Object getInfo( Context ctx, Request req,
  +                              int info, String k )
  +    {
  +     if( req!=null )
  +         return null;
  +     if( info== attributeInfo ) {
  +         // request for a context attribute, handled by tomcat
  +         if (k.equals(ATTRIB_WORKDIR)) {
  +             return ctx.getWorkDir();
  +         }
  +     }
  +     return null;
  +    }
  +    
       // -------------------- Implementation --------------------
   
       /** Encoded ContextManager.getWorkDir() + host + port + path
  
  
  

Reply via email to