Class OsgiUtils

    • Method Detail

      • getAllBundleExports

        public static Set<StringgetAllBundleExports​(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 files
        pkgs - The set of packages to use
        Returns:
        All the exported packages of all bundles on the classpath.
      • splitIntoPackages

        public static Set<StringsplitIntoPackages​(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<FilegetClasspathCandidates​(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.