tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/loader WebappClassLoader.java
Date Sun, 22 Feb 2004 21:04:18 GMT
markt       2004/02/22 13:04:18

  Modified:    catalina/src/share/org/apache/catalina/loader
                        WebappClassLoader.java
  Log:
  - Fix bug 10469. Inconsistent encoding of URLs.
  - Remove missing imports (thanks to Eclipse).
  - Access static method, Thread.dumpStack(), in a static way (Eclipse again).
  
  Revision  Changes    Path
  1.50      +20 -13    jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/loader/WebappClassLoader.java
  
  Index: WebappClassLoader.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/loader/WebappClassLoader.java,v
  retrieving revision 1.49
  retrieving revision 1.50
  diff -u -r1.49 -r1.50
  --- WebappClassLoader.java	29 Apr 2003 22:03:08 -0000	1.49
  +++ WebappClassLoader.java	22 Feb 2004 21:04:18 -0000	1.50
  @@ -69,13 +69,9 @@
   import java.io.InputStream;
   import java.io.ByteArrayInputStream;
   import java.io.IOException;
  -import java.net.JarURLConnection;
   import java.net.MalformedURLException;
   import java.net.URL;
   import java.net.URLClassLoader;
  -import java.net.URLConnection;
  -import java.net.URLStreamHandlerFactory;
  -import java.net.URLStreamHandler;
   import java.security.AccessControlException;
   import java.security.AccessController;
   import java.security.CodeSource;
  @@ -83,7 +79,6 @@
   import java.security.PermissionCollection;
   import java.security.Policy;
   import java.security.PrivilegedAction;
  -import java.security.cert.Certificate;
   import java.util.ArrayList;
   import java.util.Enumeration;
   import java.util.HashMap;
  @@ -91,7 +86,6 @@
   import java.util.Vector;
   import java.util.jar.JarFile;
   import java.util.jar.JarEntry;
  -import java.util.jar.JarInputStream;
   import java.util.jar.Manifest;
   import java.util.jar.Attributes;
   import java.util.jar.Attributes.Name;
  @@ -102,9 +96,9 @@
   import javax.naming.NameClassPair;
   
   import org.apache.catalina.Lifecycle;
  -import org.apache.catalina.LifecycleEvent;
   import org.apache.catalina.LifecycleException;
   import org.apache.catalina.LifecycleListener;
  +import org.apache.catalina.util.URLEncoder;
   
   import org.apache.naming.JndiPermission;
   import org.apache.naming.resources.ResourceAttributes;
  @@ -1326,7 +1320,7 @@
           // Don't load classes if class loader is stopped
           if (!started) {
               log("Lifecycle error : CL stopped");
  -            Thread.currentThread().dumpStack();
  +            Thread.dumpStack();
               throw new ClassNotFoundException(name);
           }
   
  @@ -2062,8 +2056,21 @@
           }
   
           //return new URL("file:" + realFile.getPath());
  -        return realFile.toURL();
  +        URLEncoder urlEncoder = new URLEncoder();
  +        urlEncoder.addSafeCharacter(',');
  +        urlEncoder.addSafeCharacter(':');
  +        urlEncoder.addSafeCharacter('-');
  +        urlEncoder.addSafeCharacter('_');
  +        urlEncoder.addSafeCharacter('.');
  +        urlEncoder.addSafeCharacter('*');
  +        urlEncoder.addSafeCharacter('/');
  +        urlEncoder.addSafeCharacter('!');
  +        urlEncoder.addSafeCharacter('~');
  +        urlEncoder.addSafeCharacter('\'');
  +        urlEncoder.addSafeCharacter('(');
  +        urlEncoder.addSafeCharacter(')');
   
  +        return new URL(urlEncoder.encode(realFile.toURL().toString()));
       }
   
   
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org


Mime
View raw message