Class FakeURLStreamHandler

java.lang.Object
java.net.URLStreamHandler
org.apache.felix.framework.FakeURLStreamHandler

class FakeURLStreamHandler extends URLStreamHandler
This class implements a fake stream handler. This class is necessary in some cases when assigning CodeSources to classes in BundleClassLoader. In general, the bundle location is an URL and this URL is used as the code source for the bundle's associated classes. The OSGi specification does not require that the bundle location be an URL, though, so in that case we try to generate a fake URL for the code source of the bundle, which is just the location string prepended with the "location:" protocol, by default. We need this fake handler to avoid an unknown protocol exception.