Top Description Fields Constructors Methods
org.jruby.embed.osgi.utils

public Class OSGiFileLocator

extends Object
Class Inheritance
Imports
java.io.File, .IOException, java.lang.reflect.Method, java.net.URL, .URLConnection, org.osgi.framework.Bundle, .BundleContext, .BundleException, .FrameworkUtil

Helper methods for the Ruby Runtime.
Author
hmalphettes

Field Summary

Modifier and TypeField and Description
private static Method
private static Method
public static final String

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static Bundle

Returns:

The bundle with this symbolic name
getBundle
(String symbolicName)

public static File
getFileInBundle(String symbolicName, String path)

public static File
public static URL

Returns:

a URL to the content of the bundle entry that uses the file: protocol
getFileURL
(URL url)

Only useful for equinox: on felix we get the file:// url already.

public static URL

Returns:

a URL to the bundle entry that uses a common protocol
getLocalURL
(URL url)

Only useful for equinox: on felix we get the file:// or jar:// url already.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

BUNDLE_URL_CONNECTION_getFileURLback to summary
private static Method BUNDLE_URL_CONNECTION_getFileURL
BUNDLE_URL_CONNECTION_getLocalURLback to summary
private static Method BUNDLE_URL_CONNECTION_getLocalURL
JRUBY_SYMBOLIC_NAMEback to summary
public static final String JRUBY_SYMBOLIC_NAME

Constructor Detail

OSGiFileLocatorback to summary
public OSGiFileLocator()

Method Detail

getBundleback to summary
public static Bundle getBundle(String symbolicName)
Returns:Bundle

The bundle with this symbolic name

getFileInBundleback to summary
public static File getFileInBundle(String symbolicName, String path) throws IOException
getFileInBundleback to summary
public static File getFileInBundle(Bundle bundle, String path) throws IOException
getFileURLback to summary
public static URL getFileURL(URL url)

Only useful for equinox: on felix we get the file:// url already. Other OSGi implementations have not been tested

Get a URL to the content of the bundle entry that uses the file: protocol. The content of the bundle entry may be downloaded or extracted to the local file system in order to create a file: URL.

Returns:URL

a URL to the content of the bundle entry that uses the file: protocol

getLocalURLback to summary
public static URL getLocalURL(URL url)

Only useful for equinox: on felix we get the file:// or jar:// url already. Other OSGi implementations have not been tested

Get a URL to the bundle entry that uses a common protocol (i.e. file: jar: or http: etc.).

Returns:URL

a URL to the bundle entry that uses a common protocol