Package org.openhab.core.common.osgi
Class ResourceBundleClassLoader
java.lang.Object
java.lang.ClassLoader
org.openhab.core.common.osgi.ResourceBundleClassLoader
The
ResourceBundleClassLoader
is a user defined classloader which is
responsible to map files within an OSGi bundle to URL
s. This
implementation only supports the method getResource(String)
for
mappings.- Author:
- Michael Grammling - Initial contribution, Martin Herbst - UTF-8 replaced by ISO-8859-1 to follow Java standards
-
Constructor Summary
ConstructorDescriptionResourceBundleClassLoader
(org.osgi.framework.Bundle bundle, String path, String filePattern) Creates a new instance of this class with the specified parameters. -
Method Summary
Methods inherited from class java.lang.ClassLoader
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findClass, findClass, findLibrary, findLoadedClass, findResource, findResource, findResources, findSystemClass, getClassLoadingLock, getDefinedPackage, getDefinedPackages, getName, getPackage, getPackages, getParent, getPlatformClassLoader, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, getUnnamedModule, isRegisteredAsParallelCapable, loadClass, loadClass, registerAsParallelCapable, resolveClass, resources, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners
-
Constructor Details
-
ResourceBundleClassLoader
public ResourceBundleClassLoader(org.osgi.framework.Bundle bundle, String path, String filePattern) throws IllegalArgumentException Creates a new instance of this class with the specified parameters.- Parameters:
bundle
- the bundle whose files should be mapped (must not be null)path
- the path within the bundle which should be considered to be mapped. If null is set, all files within the bundle are considered.filePattern
- the pattern for files to be considered within the specified path. If null is set, all files within the specified path are considered.- Throws:
IllegalArgumentException
- if the bundle is null
-
-
Method Details
-
getResource
- Overrides:
getResource
in classClassLoader
-
getResourceAsStream
- Overrides:
getResourceAsStream
in classClassLoader
-