You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ru...@locus.apache.org on 2000/02/12 20:50:41 UTC

cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/loader AdaptiveServletLoader.java ServletClassLoaderImpl.java

rubys       00/02/12 11:50:41

  Modified:    src/share/org/apache/tomcat/loader
                        AdaptiveServletLoader.java
                        ServletClassLoaderImpl.java
  Log:
  More fun and games with JDK 1.1.
  
  SimpleFileFilter was dying in getParent due to wrong way slashes.
  Instead of proliferating FileUtil.patch calls, I decided to fix
  these at the source (the classpath vector itself).  This has the
  added advantage of fixing up the file once on creation instead of
  every time on reference.
  
  Revision  Changes    Path
  1.3       +6 -6      jakarta-tomcat/src/share/org/apache/tomcat/loader/AdaptiveServletLoader.java
  
  Index: AdaptiveServletLoader.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/loader/AdaptiveServletLoader.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- AdaptiveServletLoader.java	2000/02/10 18:55:55	1.2
  +++ AdaptiveServletLoader.java	2000/02/12 19:50:40	1.3
  @@ -151,11 +151,7 @@
           for(Enumeration e = classP.elements() ; e.hasMoreElements(); ) {
               File f = (File) e.nextElement();
               if (cpath.length()>0) cpath += separator;
  -	    try {
  -		cpath += FileUtil.patch(f.getCanonicalPath());
  -	    } catch( IOException ex) {
  -		ex.printStackTrace();
  -	    }
  +            cpath += f;
           }
   
           return cpath;
  @@ -168,7 +164,11 @@
        */
       public void addRepository( File f ) {
   	//	System.out.println("Adding " + f.getName() );
  -	classP.addElement( f );
  +	try {
  +	    classP.addElement(new File(FileUtil.patch(f.getCanonicalPath())));
  +	} catch( IOException ex) {
  +            ex.printStackTrace();
  +	}
       }
   
       /** Add a new remote repository. Not all class loader will
  
  
  
  1.7       +3 -6      jakarta-tomcat/src/share/org/apache/tomcat/loader/ServletClassLoaderImpl.java
  
  Index: ServletClassLoaderImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/loader/ServletClassLoaderImpl.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- ServletClassLoaderImpl.java	2000/02/10 18:55:55	1.6
  +++ ServletClassLoaderImpl.java	2000/02/12 19:50:40	1.7
  @@ -137,11 +137,7 @@
           for(Enumeration e = classP.elements() ; e.hasMoreElements(); ) {
               File f = (File) e.nextElement();
               if (cpath.length()>0) cpath += separator;
  -	    try {
  -		cpath += FileUtil.patch(f.getCanonicalPath());
  -	    } catch( IOException ex) {
  -		ex.printStackTrace();
  -	    }
  +	    cpath += f;
           }
   
           return cpath;
  @@ -153,8 +149,9 @@
        *  that may require a reload.
        */
       public void addRepository( File f ) {
  -	classP.addElement( f );
   	try {
  +	    classP.addElement(new File(FileUtil.patch(f.getCanonicalPath())));
  +
   	    String path=f.getCanonicalPath();
   	    // NetworkClassLoader will use the last char to
   	    // decide if it's a directory or a jar.