remm        2002/11/06 05:37:03

  Modified:    catalina/src/share/org/apache/catalina/core
                        ApplicationContext.java
  Log:
  - Add path normalization for getResource and getResourceAsStream.
  
  Revision  Changes    Path
  1.6       +17 -4     
jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core/ApplicationContext.java
  
  Index: ApplicationContext.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core/ApplicationContext.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- ApplicationContext.java   6 Nov 2002 13:27:54 -0000       1.5
  +++ ApplicationContext.java   6 Nov 2002 13:37:03 -0000       1.6
  @@ -597,6 +597,11 @@
        */
       public URL getResource(String path)
           throws MalformedURLException {
  +
  +        path = normalize(path);
  +        if (path == null)
  +            return (null);
  +
           DirContext resources = context.getResources();
           if (resources != null) {
               String fullPath = context.getName() + path;
  @@ -636,6 +641,10 @@
        */
       public InputStream getResourceAsStream(String path) {
   
  +        path = normalize(path);
  +        if (path == null)
  +            return (null);
  +
           DirContext resources = context.getResources();
           if (resources != null) {
               try {
  @@ -658,6 +667,10 @@
        * @param path Collection path
        */
       public Set getResourcePaths(String path) {
  +
  +        path = normalize(path);
  +        if (path == null)
  +            return (null);
   
           DirContext resources = context.getResources();
           if (resources != null) {
  
  
  

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

Reply via email to