org.jruby.embed.osgi.utils
Class OSGiFileLocator

java.lang.Object
  extended by org.jruby.embed.osgi.utils.OSGiFileLocator

public class OSGiFileLocator
extends java.lang.Object

Helper methods for the Ruby Runtime.

Author:
hmalphettes

Field Summary
static java.lang.String JRUBY_SYMBOLIC_NAME
           
 
Constructor Summary
OSGiFileLocator()
           
 
Method Summary
static org.osgi.framework.Bundle getBundle(java.lang.String symbolicName)
           
static java.io.File getFileInBundle(org.osgi.framework.Bundle bundle, java.lang.String path)
           
static java.io.File getFileInBundle(java.lang.String symbolicName, java.lang.String path)
           
static java.net.URL getFileURL(java.net.URL url)
          Only useful for equinox: on felix we get the file:// url already.
static java.io.File getJRubyHomeFolder()
           
static java.net.URL getLocalURL(java.net.URL url)
          Only useful for equinox: on felix we get the file:// or jar:// url already.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

JRUBY_SYMBOLIC_NAME

public static final java.lang.String JRUBY_SYMBOLIC_NAME
See Also:
Constant Field Values
Constructor Detail

OSGiFileLocator

public OSGiFileLocator()
Method Detail

getJRubyHomeFolder

public static java.io.File getJRubyHomeFolder()
                                       throws java.io.IOException
Returns:
The home for gems and other files as provided by jruby.
Throws:
java.io.IOException

getFileInBundle

public static java.io.File getFileInBundle(java.lang.String symbolicName,
                                           java.lang.String path)
                                    throws java.io.IOException
Throws:
java.io.IOException

getFileInBundle

public static java.io.File getFileInBundle(org.osgi.framework.Bundle bundle,
                                           java.lang.String path)
                                    throws java.io.IOException
Throws:
java.io.IOException

getBundle

public static org.osgi.framework.Bundle getBundle(java.lang.String symbolicName)
Parameters:
symbolicName -
Returns:
The bundle with this symbolic name

getLocalURL

public static java.net.URL getLocalURL(java.net.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:
a URL to the bundle entry that uses a common protocol

getFileURL

public static java.net.URL getFileURL(java.net.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:
a URL to the content of the bundle entry that uses the file: protocol



Copyright © 2002-2009 JRuby Team. All Rights Reserved.