You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@felix.apache.org by ri...@apache.org on 2006/02/03 16:03:28 UTC

svn commit: r374680 - /incubator/felix/trunk/org.apache.felix.framework/src/main/java/org/apache/felix/framework/Felix.java

Author: rickhall
Date: Fri Feb  3 07:03:24 2006
New Revision: 374680

URL: http://svn.apache.org/viewcvs?rev=374680&view=rev
Log:
Fixed a bug in getBundleResource() where it was only searching the local
bundle and not the imports of the bundle. Also removed some unneeded code.

Modified:
    incubator/felix/trunk/org.apache.felix.framework/src/main/java/org/apache/felix/framework/Felix.java

Modified: incubator/felix/trunk/org.apache.felix.framework/src/main/java/org/apache/felix/framework/Felix.java
URL: http://svn.apache.org/viewcvs/incubator/felix/trunk/org.apache.felix.framework/src/main/java/org/apache/felix/framework/Felix.java?rev=374680&r1=374679&r2=374680&view=diff
==============================================================================
--- incubator/felix/trunk/org.apache.felix.framework/src/main/java/org/apache/felix/framework/Felix.java (original)
+++ incubator/felix/trunk/org.apache.felix.framework/src/main/java/org/apache/felix/framework/Felix.java Fri Feb  3 07:03:24 2006
@@ -922,52 +922,6 @@
         return false;
     }
 
-    /**
-     * <p>
-     * This method returns an input stream for the specified bundle resource
-     * URL.
-     * </p>
-     * @param url the URL representing the bundle resource for which an input
-     *        stream is desired.
-     * @return an input stream to the bundle resource.
-     * @throws IOException if the input stream could not be created.
-    **/
-/*
- This might note be needed due to changes in URLHandlersBundleURLConnection
-
-    protected InputStream getBundleResourceInputStream(URL url)
-        throws IOException
-    {
-        // The URL is constructed like this:
-        // bundle://<module-id>/<source-idx>/<resource-path>
-    
-        IModule module = m_factory.getModule(url.getHost());
-        if (module == null)
-        {
-            throw new IOException("Unable to find bundle's module.");
-        }
-    
-        String resource = url.getFile();
-        if (resource == null)
-        {
-            throw new IOException("Unable to find resource: " + url.toString());
-        }
-
-        // Remove any leading slash.
-        if (resource.startsWith("/"))
-        {
-            resource = resource.substring(1);
-        }
-
-        // Get the resource bytes from the resource source.
-        byte[] bytes = module.getContentLoader().getResourceBytes(resource);
-        if (bytes == null)
-        {
-            throw new IOException("Unable to find resource: " + url.toString());
-        }
-        return new ByteArrayInputStream(bytes);
-    }
-*/
     //
     // Implementation of Bundle interface methods.
     //
@@ -1009,7 +963,7 @@
         {
             AccessController.checkPermission(m_adminPerm);
         }
-        return bundle.getInfo().getCurrentModule().getContentLoader().getResource(name);
+        return bundle.getInfo().getCurrentModule().getResource(name);
     }
 
     protected ServiceReference[] getBundleRegisteredServices(BundleImpl bundle)