Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Excerpt
hiddentrue

classpath: protocol handler. Provides access to classpath resources from your bundle or other bundles installed.

Pax URL Classpath is an OSGi URL handler provides access to resources from thread classpath or all installed bundles or a specific bundle. The searched bundle are only those that are nnot protected by permissions.
The resource is searched by:

  1. first look if the bundle symbolic name was specified. If that's the case and the bundle was found then the resource is searched in that bundle. If the resource is found it is returned otherwise an IOException is thrown. If the bundle is not found then an IOException is thrown.
  2. look in the current thread classpath. If found the resource is returned
  3. if not found in thread classpath search all the bundles available and return the first resource found
  4. if still not found an IOException is thrown

Syntax ( see #examples )

Code Block
Wiki Markup
{excerpt:hidden=true}classpath: protocol handler. Provides access to classpath resources from your bundle or other bundles installed.{excerpt}

{scrollbar}

Pax URL Classpath is an OSGi URL handler provides access to resources from thread classpath or all installed bundles or a specific bundle. The searched bundle are only those that are nnot protected by permissions.
The resource is searched by:
# first look if the bundle symbolic name was specified. If that's the case and the bundle was found then the resource is searched in that bundle. If the resource is found it is returned otherwise an IOException is thrown. If the bundle is not found then an IOException is thrown.
# look in the current thread classpath. If found the resource is returned
# if not found in thread classpath search all the bundles available and return the first resource found
# if still not found an IOException is thrown

h4. Syntax ( see [#examples] )
{code}
classpath-uri := "claspath:" [ "//" bundle-symbolic-name "/" ] path-to-resource
bundle-symbolic-name := <any> ; a valid bundle symbolic name from where the resource to be loaded
path-to-resource := <any> ; path to the resources to be loaded
{code}

{anchor

...

Examples

...

:examples}
h4. Examples

Loads my-bundle.conf file by searching all the bundles installed.

...


{code
}
classpath:my-bundle.conf
{code}

Loads my-bundle.conf from the bundle with symbolic name my-bundle

...

 
{code
}
classpath:my-bundle/my-bundle.conf
{code}

{scrollbar}