Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [equinox-dev] Bundle.getEntry(...) does not look in the fragment


Hi Pascal,

The getEntry() method is intended to only return entries in the specific Bundle and not take into consideration the fragment or host bundles.  If fragment and host bundles were taken into consideration then the eclipse runtime would not be able to do a Bundle.getEntry("plugin.xml") on any fragment bundles because the host "plugin.xml" would override the one in the fragment.  What would be the behavior of getEntry() on a fragment bundle?  Would it have to look in the host first and then the fragments?  This can not be an option because we are going to have to support fragments that attach to multiple hosts soon.  We could not determine which host to use in that case.  Finally, we want the getEntry() method to work even when a bundle is unresolved.  Since we do not need a classloader to implement getEntry() that means it works the same on host and fragment bundles even when they are not resolved.

The getResource() method is intended to use the classloader of the Bundle to get a resource.  This will take into consideration a bundle's imports, requires, and fragment bundles but does not include any resources that are not on the Bundle-ClassPath (typically eclipse plugins do not include "." on the Bundle-ClassPath so this does not work for most of the eclipse use cases).

Thomas Watson
Pervasive Development
Phone: 512-838-4533 Tie: 678-4533
tjwatson@xxxxxxxxxx



Pascal Rapicault <Pascal_Rapicault@xxxxxxxxxx>
Sent by: equinox-dev-admin@xxxxxxxxxxx

02/16/2004 12:21 PM

       
        To:        equinox-dev@xxxxxxxxxxx
        cc:        
        Subject:        [equinox-dev] Bundle.getEntry(...) does not look in the fragment




Hi,


Looking at the implementation of Bundle.getEntry(file) it seems that this method does not search for the file inside the fragments.

I know/understand that I can do it myself easily by getting the fragments and then iterating over them, but I'm just wondering what are the reasons

for this behavior?


       PaScaL


Back to the top