public class BundleResourceHelper extends Object
Bundle
.
Bundle.getResource(String)
or
Bundle.getResources(String)
does not return the resources found in the wired bundles of the bundle
(wired via Import-Package or DynamicImport-Package). This class loader implementation provides
#getResource(String) and {@link #getResources(String)} methods that do delegate META-INF resource lookups
to the wired bundles.
Modifier and Type | Field and Description |
---|---|
protected org.osgi.framework.Bundle |
bundle |
static String |
CONVERT_RESOURCE_URLS |
protected boolean |
convertResourceUrls |
static String |
SEARCH_WIRED_BUNDLES |
protected boolean |
searchWiredBundles |
Constructor and Description |
---|
BundleResourceHelper(org.osgi.framework.Bundle bundle) |
BundleResourceHelper(org.osgi.framework.Bundle bundle,
boolean searchWiredBundles,
boolean convertResourceUrls) |
Modifier and Type | Method and Description |
---|---|
protected URL |
convert(URL url) |
protected URL |
convertedFindResource(String name)
Lookup resource and return converted URL (in a generic way).
|
protected Enumeration<URL> |
convertedFindResources(String name)
Lookup resources and return converted URLs (in a generic way).
|
protected URL |
findResource(String name) |
protected Enumeration<URL> |
findResources(String name) |
boolean |
getConvertResourceUrls() |
static boolean |
getConvertResourceUrls(boolean defaultValue) |
URL |
getResource(String name) |
Enumeration<URL> |
getResources(String name) |
boolean |
getSearchWiredBundles() |
static boolean |
getSearchWiredBundles(boolean defaultValue) |
void |
setConvertResourceUrls(boolean convert) |
void |
setSearchWiredBundles(boolean search) |
public static final String SEARCH_WIRED_BUNDLES
public static final String CONVERT_RESOURCE_URLS
protected final org.osgi.framework.Bundle bundle
protected boolean searchWiredBundles
protected boolean convertResourceUrls
public BundleResourceHelper(org.osgi.framework.Bundle bundle)
public BundleResourceHelper(org.osgi.framework.Bundle bundle, boolean searchWiredBundles, boolean convertResourceUrls)
public void setSearchWiredBundles(boolean search)
public boolean getSearchWiredBundles()
public void setConvertResourceUrls(boolean convert)
public boolean getConvertResourceUrls()
public Enumeration<URL> getResources(String name) throws IOException
IOException
protected Enumeration<URL> findResources(String name) throws IOException
IOException
protected URL convertedFindResource(String name)
name
- protected Enumeration<URL> convertedFindResources(String name) throws IOException
name
- IOException
public static boolean getSearchWiredBundles(boolean defaultValue)
public static boolean getConvertResourceUrls(boolean defaultValue)
Copyright © 2005–2015. All rights reserved.