geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dblev...@apache.org
Subject svn commit: r475549 - /geronimo/xbean/trunk/xbean-finder/src/main/java/org/apache/xbean/finder/ResourceFinder.java
Date Thu, 16 Nov 2006 03:02:32 GMT
Author: dblevins
Date: Wed Nov 15 19:02:32 2006
New Revision: 475549

URL: http://svn.apache.org/viewvc?view=rev&rev=475549
Log:
Added hack for jars that are not compliant

Modified:
    geronimo/xbean/trunk/xbean-finder/src/main/java/org/apache/xbean/finder/ResourceFinder.java

Modified: geronimo/xbean/trunk/xbean-finder/src/main/java/org/apache/xbean/finder/ResourceFinder.java
URL: http://svn.apache.org/viewvc/geronimo/xbean/trunk/xbean-finder/src/main/java/org/apache/xbean/finder/ResourceFinder.java?view=diff&rev=475549&r1=475548&r2=475549
==============================================================================
--- geronimo/xbean/trunk/xbean-finder/src/main/java/org/apache/xbean/finder/ResourceFinder.java
(original)
+++ geronimo/xbean/trunk/xbean-finder/src/main/java/org/apache/xbean/finder/ResourceFinder.java
Wed Nov 15 19:02:32 2006
@@ -123,7 +123,7 @@
 
         URL resource = getResource(fullUri);
         if (resource == null) {
-            throw new IOException("Could not find a resource in : " + fullUri);
+            throw new IOException("Could not find resource '" + fullUri + "'");
         }
 
         return resource;
@@ -868,7 +868,8 @@
 
     private static void readJarEntries(URL location, String basePath, Map<String, URL>
resources) throws IOException {
         JarURLConnection conn = (JarURLConnection) location.openConnection();
-        JarFile jarfile = conn.getJarFile();
+        JarFile jarfile = null;
+        jarfile = conn.getJarFile();
 
         Enumeration<JarEntry> entries = jarfile.entries();
         while (entries != null && entries.hasMoreElements()) {
@@ -995,6 +996,9 @@
                         sb.append(file.substring(sepIdx));
                         sb.append(resourceName);
                         entryName = sb.toString();
+                    }
+                    if (entryName.equals("META-INF/") && jarFile.getEntry("META-INF/MANIFEST.MF")
!= null){
+                        return targetURL(currentUrl, "META-INF/MANIFEST.MF");
                     }
                     if (jarFile.getEntry(entryName) != null) {
                         return targetURL(currentUrl, resourceName);



Mime
View raw message