Reference Protocol

A reference: URL wraps a file: URL to avoid copying the file. Using a reference URL for provisioning a bundle to an OSGi framework, the framework will not copy the bundle to the framework install area, but provision it from the referenced location. Reference URLs work both for regular and for exploded (i.e. unzipped) bundles.

This is useful for provisioning a bundle directly from a development workspace.

The reference: protocol is not part of the OSGi Core Specification 4.3, but it is supported by Equinox, Felix and Knopflerfish.

When connecting to a reference: URL, a new URL is created by stripping the reference: prefix. This stripped URL is used for accessing the resource. The stripped URL must be a file: URL. The input stream obtained from a reference URL is just a stub, calling read() on this stream will throw an exception.

Syntax

reference-uri := 'reference:' file-uri

Examples

Reference to a bundle JAR:

reference:file:/home/hwellmann/work/mybundle.jar

Reference to an exploded bundle:

reference:file:/home/hwellmann/work/mybundle/