public class DefaultFileLocatorHelper extends java.lang.Object implements BundleFileLocatorHelper
CLASS_NAME, DEFAULT| Constructor and Description |
|---|
DefaultFileLocatorHelper() |
| Modifier and Type | Method and Description |
|---|---|
java.util.Enumeration<java.net.URL> |
findEntries(org.osgi.framework.Bundle bundle,
java.lang.String entryPath)
Helper method equivalent to Bundle#getEntry(String entryPath) except that
it searches for entries in the fragments by using the Bundle#findEntries
method.
|
java.io.File |
getBundleInstallLocation(org.osgi.framework.Bundle bundle)
Works with equinox, felix, nuxeo and probably more.
|
java.io.File |
getFileInBundle(org.osgi.framework.Bundle bundle,
java.lang.String path)
Locate a file inside a bundle.
|
java.net.URL |
getFileURL(java.net.URL url)
Only useful for equinox: on felix we get the file:// url already.
|
java.net.URL |
getLocalURL(java.net.URL url)
Only useful for equinox: on felix we get the file:// or jar:// url
already.
|
java.io.File[] |
locateJarsInsideBundle(org.osgi.framework.Bundle bundle)
If the bundle is a jar, returns the jar.
|
public java.io.File getBundleInstallLocation(org.osgi.framework.Bundle bundle)
throws java.lang.Exception
getBundleInstallLocation in interface BundleFileLocatorHelperbundle - The bundlejava.lang.Exceptionpublic java.io.File getFileInBundle(org.osgi.framework.Bundle bundle,
java.lang.String path)
throws java.lang.Exception
getFileInBundle in interface BundleFileLocatorHelperbundle - path - java.lang.Exceptionpublic java.util.Enumeration<java.net.URL> findEntries(org.osgi.framework.Bundle bundle,
java.lang.String entryPath)
findEntries in interface BundleFileLocatorHelperbundle - entryPath - public java.io.File[] locateJarsInsideBundle(org.osgi.framework.Bundle bundle)
throws java.lang.Exception
Good enough for our purpose (TldLocationsCache when it scans for tld files inside jars alone. In fact we only support the second situation for development purpose where the bundle was imported in pde and the classes kept in a jar.
locateJarsInsideBundle in interface BundleFileLocatorHelperbundle - java.lang.Exceptionpublic java.net.URL getLocalURL(java.net.URL url)
Get a URL to the bundle entry that uses a common protocol (i.e. file: jar: or http: etc.).
getLocalURL in interface BundleFileLocatorHelperpublic java.net.URL getFileURL(java.net.URL url)
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.
getFileURL in interface BundleFileLocatorHelperCopyright © 2013 FuseSource, Corp.. All Rights Reserved.