tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@hyperreal.org
Subject cvs commit: jakarta-tools/moo/src/share/org/apache/tools/moo/jsp MapManager.java
Date Tue, 02 Nov 1999 18:20:09 GMT
arun        99/11/02 10:20:08

  Modified:    moo/src/share/org/apache/tools/moo/jsp MapManager.java
  Log:
  Support for multiple context root.
  
  Revision  Changes    Path
  1.5       +19 -10    jakarta-tools/moo/src/share/org/apache/tools/moo/jsp/MapManager.java
  
  Index: MapManager.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tools/moo/src/share/org/apache/tools/moo/jsp/MapManager.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- MapManager.java	1999/11/02 01:03:06	1.4
  +++ MapManager.java	1999/11/02 18:20:07	1.5
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tools/moo/src/share/org/apache/tools/moo/jsp/MapManager.java,v
1.4 1999/11/02 01:03:06 arun Exp $ 
  - * $Date: 1999/11/02 01:03:06 $ 
  - * $Revision: 1.4 $
  + * $Header: /home/cvs/jakarta-tools/moo/src/share/org/apache/tools/moo/jsp/MapManager.java,v
1.5 1999/11/02 18:20:07 arun Exp $ 
  + * $Date: 1999/11/02 18:20:07 $ 
  + * $Revision: 1.5 $
    * 
    * The Apache Software License, Version 1.1
    *
  @@ -86,6 +86,8 @@
       //maps is a hashtable from client test (key) to server test (value)
       private Hashtable maps = new Hashtable();
   
  +    private Hashtable resMap = new Hashtable();
  +
       //offers some configurability options such as the base directory of
       // server resources (ie server-side tests)
       private static final String ConfigFile =  Constants.Config.propDir +
  @@ -93,8 +95,7 @@
   
       public String resourceBase;
   
  -    public
  -    MapManager() {
  +    public MapManager() {
   
           String defaultResourceBase = "/jsp-tests";
           Properties props = new Properties();
  @@ -155,10 +156,13 @@
               if (uri.trim().charAt(0) != '/') {
                   String value = prefix + uri;
                   maps.put(key, value);
  +                resMap.put(key, this.resourceBase);
               } else {
                   StringTokenizer stok = new StringTokenizer(uri, "/");
  -                if (stok.hasMoreElements())
  -                    this.resourceBase = "/" + (String) stok.nextToken();
  +                if (stok.hasMoreElements()) {
  +                    String resBase = "/" + (String) stok.nextToken();
  +                    resMap.put(key, resBase);
  +                }
               }
           }
       }
  @@ -172,6 +176,10 @@
           return (String)maps.get(testName);
       }
   
  +    public String getResourceBase (String testName) {
  +        return (String)resMap.get(testName);
  +    }
  +
       /**
        * return the URL prefix for the golden file.
        */
  @@ -179,13 +187,14 @@
       throws FileNotFoundException {
   
           String toConnect = get(mapResource);
  -        int index = toConnect.lastIndexOf(this.resourceBase);
  +        String resBase = getResourceBase(mapResource);
  +        int index = toConnect.lastIndexOf(resBase);
   
           if (index == -1)
               throw new FileNotFoundException("GoldenFile URL incorrect");
   
  -        return  toConnect.substring(0,index) + this.resourceBase + "/golden-files/" +
  -                goldenFile;
  +        return  toConnect.substring(0,index) + resBase
  +                    + "/golden-files/" + goldenFile;
       }
   
   
  
  
  

Mime
View raw message