repo1.maven.org$maven2@org.jruby$jruby@1.6.0.RC3@org$jruby$embed$osgi$utils$OSGiFileLocator.java
oh
o
[{"sl":132,"sc":-1,"el":132,"ec":-1,"m":"org.jruby.embed.osgi.utils.OSGiFileLocator.getLocalURL(URL) invokes reflect.Method.setAccessible(boolean), which should be invoked from within a doPrivileged block","p":3,"t":"DP_DO_INSIDE_DO_PRIVILEGED","a":"DP","c":"BAD_PRACTICE"},{"sl":165,"sc":-1,"el":165,"ec":-1,"m":"org.jruby.embed.osgi.utils.OSGiFileLocator.getFileURL(URL) invokes reflect.Method.setAccessible(boolean), which should be invoked from within a doPrivileged block","p":3,"t":"DP_DO_INSIDE_DO_PRIVILEGED","a":"DP","c":"BAD_PRACTICE"},{"sl":128,"sc":-1,"el":131,"ec":-1,"m":"Incorrect lazy initialization and update of static field org.jruby.embed.osgi.utils.OSGiFileLocator.BUNDLE_URL_CONNECTION_getLocalURL in org.jruby.embed.osgi.utils.OSGiFileLocator.getLocalURL(URL)","p":2,"t":"LI_LAZY_INIT_UPDATE_STATIC","a":"LI","c":"MT_CORRECTNESS"},{"sl":160,"sc":-1,"el":164,"ec":-1,"m":"Incorrect lazy initialization and update of static field org.jruby.embed.osgi.utils.OSGiFileLocator.BUNDLE_URL_CONNECTION_getFileURL in org.jruby.embed.osgi.utils.OSGiFileLocator.getFileURL(URL)","p":2,"t":"LI_LAZY_INIT_UPDATE_STATIC","a":"LI","c":"MT_CORRECTNESS"},{"sl":71,"sc":-1,"el":71,"ec":-1,"m":"Dead store to ne in org.jruby.embed.osgi.utils.OSGiFileLocator.getFileInBundle(Bundle, String)","p":5,"t":"DLS_DEAD_LOCAL_STORE","a":"DLS","c":"STYLE"},{"sl":92,"sc":-1,"el":92,"ec":-1,"m":"Dead store to e in org.jruby.embed.osgi.utils.OSGiFileLocator.getBundle(String)","p":5,"t":"DLS_DEAD_LOCAL_STORE","a":"DLS","c":"STYLE"},{"sl":74,"sc":-1,"el":74,"ec":-1,"m":"Exception is caught when Exception is not thrown in org.jruby.embed.osgi.utils.OSGiFileLocator.getFileInBundle(Bundle, String)","p":5,"t":"REC_CATCH_EXCEPTION","a":"REC","c":"STYLE"}]
BEGIN LICENSE BLOCK *****
Version: CPL 1.0/GPL 2.0/LGPL 2.1
The contents of this file are subject to the Common Public
License Version 1.0 (the "License"); you may not use this file
except in compliance with the License. You may obtain a copy of
the License at http://www.eclipse.org/legal/cpl-v10.html
Software distributed under the License is distributed on an "AS
IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
implied. See the License for the specific language governing
rights and limitations under the License.
Copyright (C) 2002-2011 JRuby Community
Alternatively, the contents of this file may be used under the terms of
either of the GNU General Public License Version 2 or later (the "GPL"),
or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
in which case the provisions of the GPL or the LGPL are applicable instead
of those above. If you wish to allow use of your version of this file only
under the terms of either the GPL or the LGPL, and not to allow others to
use your version of this file under the terms of the CPL, indicate your
decision by deleting the provisions above and replace them with the notice
and other provisions required by the GPL or the LGPL. If you do not delete
the provisions above, a recipient may use your version of this file under
the terms of any one of the CPL, the GPL or the LGPL.
END LICENSE BLOCK ***
package org.jruby.embed.osgi.utils;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
import org.osgi.framework.BundleException;
import org.osgi.framework.FrameworkUtil;
Helper methods for the Ruby Runtime.
- Returns:
- The home for gems and other files as provided by jruby.
throw new IOException("Unable to find the bundle " + symbolicName); throw new IOException("Unable to find the " + path + " folder in the bundle '" + bundle.getSymbolicName() + "'; is the org.jruby.jruby bundle unzipped? ");
" folder in the bundle '" + bundle.getSymbolicName() + "'");
- Parameters:
symbolicName- Returns:
- The bundle with this symbolic name
BundleContext bc = FrameworkUtil.getBundle(OSGiFileLocator.class).getBundleContext();
} catch (BundleException e) { for (Bundle b : FrameworkUtil.getBundle(OSGiFileLocator.class).getBundleContext().getBundles()) { if (b.getSymbolicName().equals(symbolicName)) { 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
"org.eclipse.osgi.framework.internal.core.BundleURLConnection")) { 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
"org.eclipse.osgi.framework.internal.core.BundleURLConnection"))