summaryrefslogtreecommitdiff
path: root/www/cocoon/files/patch-Utils.java
blob: 5f89c384dc3e967dce805d5f159ebfa7c395438c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
$FreeBSD$

--- src/org/apache/cocoon/Utils.java.orig	Sun May 12 13:30:49 2002
+++ src/org/apache/cocoon/Utils.java	Sun May 12 13:30:58 2002
@@ -331,16 +331,20 @@
      */
     public static final Object getLocationResource(String location) throws MalformedURLException {
         Object resource = null;
-        
+
         if (location.indexOf("://") < 0) {
             resource = new File(location);
         } else if (location.startsWith("resource://")) {
             // FIXME (SM): this should _not_ be system resource, but rather a resource of current classloader
-            resource = ClassLoader.getSystemResource(location.substring("resource://".length()));
+//            resource = ClassLoader.getSystemResource(location.substring("resource://".length()));
+
+            // The Fix!
+            Dummy classloadrefernce = new Dummy();
+            resource = classloadrefernce.getClass().getClassLoader().getResource(location.substring("resource://".length()));
         } else {
             resource = new URL(location);
         }
-        
+
         return resource;
     }
 
@@ -362,11 +366,20 @@
             resource = new File(location);
         } else if (location.startsWith("resource://")) {
             // FIXME (SM): this should _not_ be system resource, but rather a resource of current classloader
-            resource = ClassLoader.getSystemResource(location.substring("resource://".length()));
+//            resource = ClassLoader.getSystemResource(location.substring("resource://".length()));
+
+            // The Fix!
+            Dummy classloadrefernce = new Dummy();
+            resource = classloadrefernce.getClass().getClassLoader().getResource(location.substring("resource://".length()));
         } else {
             resource = new URL(location);
         }
-        
+
         return resource;
     }
+
+}
+
+class Dummy {
+    String why = "to provide a classloader ref";
 }