Package org.apache.directory.api.util
Class OsgiUtils
- java.lang.Object
-
- org.apache.directory.api.util.OsgiUtils
-
public final class OsgiUtils extends Object
Utilities for OSGi environments and embedding OSGi containers.- Author:
- Apache Directory Project
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Set<String>
getAllBundleExports(FileFilter filter, Set<String> pkgs)
All the packages that are exported from all bundles found on the system classpath.static String
getBundleExports(File bundle)
Gets the attribute value for the Export-Bundle OSGi Manifest Attribute.static Set<File>
getClasspathCandidates(FileFilter filter)
Get the files that fits a given filterstatic Set<String>
splitIntoPackages(String exports, Set<String> pkgs)
Splits a Package-Export OSGi Manifest Attribute value into packages while stripping away the key/value properties.
-
-
-
Method Detail
-
getAllBundleExports
public static Set<String> getAllBundleExports(FileFilter filter, Set<String> pkgs)
All the packages that are exported from all bundles found on the system classpath. The provided filter if not null is used to prune classpath elements. Any uses terms found are stripped from the bundles.- Parameters:
filter
- The filter to use on the filespkgs
- The set of packages to use- Returns:
- All the exported packages of all bundles on the classpath.
-
splitIntoPackages
public static Set<String> splitIntoPackages(String exports, Set<String> pkgs)
Splits a Package-Export OSGi Manifest Attribute value into packages while stripping away the key/value properties.- Parameters:
exports
- The Package-Export OSGi Manifest Attribute value.pkgs
- The set that will contain the found packages.- Returns:
- The set of exported packages without properties.
-
getClasspathCandidates
public static Set<File> getClasspathCandidates(FileFilter filter)
Get the files that fits a given filter- Parameters:
filter
- The filter in use- Returns:
- The set of Files that match the filter
-
getBundleExports
public static String getBundleExports(File bundle)
Gets the attribute value for the Export-Bundle OSGi Manifest Attribute.- Parameters:
bundle
- The absolute path to a file bundle.- Returns:
- The value as it appears in the Manifest, as a comma delimited list of packages with possible "uses" phrases appended to each package or null if the attribute does not exist.
-
-