|bundle.findEntries(path, pattern, recurse) does not find entries in fragment [message #1775485]
||Mon, 30 October 2017 19:33
| Christian Eugster
Registered: July 2009
Location: St. Gallen Switzerland
I have a host bundle (a jpa persistence bundle) with several fragments, where each of them does provide an implementation of a java.sql.Driver. Each fragment als has a cfg (properties) file with information about e.g. how the url has to look like and so forth. These cfg files are in folder OSGI-INF. (Such a folder exists also in the hosts bundle. When I try to collect these cfg files from the host bundles activator, none of them is found. Do I misunderstand the explanation of this method or what could possibly go wrong? When I use another path (e.g. properties instead of OSGI-INF in one fragment, the cfg file there ist found.
"Enumeration<URL> org.osgi.framework.Bundle.findEntries(String path, String filePattern, boolean recurse)
Returns entries in this bundle and its attached fragments. This bundle's class loader is not used to search for entries. Only the contents of this bundle and its attached fragments are searched for the specified entries. If this bundle's state is INSTALLED, this method must attempt to resolve this bundle before attempting to find entries.
This method is intended to be used to obtain configuration, setup, localization and other information from this bundle. This method takes into account that the "contents" of this bundle can be extended with fragments. This "bundle space" is not a namespace with unique members; the same entry name can be present multiple times. This method therefore returns an enumeration of URL objects. These URLs can come from different JARs but have the same path name. This method can either return only entries in the specified path or recurse into subdirectories returning entries in the directory tree beginning at the specified path. Fragments can be attached after this bundle is resolved, possibly changing the set of URLs returned by this method. If this bundle is not resolved, only the entries in the JAR file of this bundle are returned."
Powered by FUDForum
. Page generated in 0.01785 seconds