Package org.apache.karaf.tooling.utils
Class ManifestUtils
- java.lang.Object
-
- org.apache.karaf.tooling.utils.ManifestUtils
-
public class ManifestUtils extends Object
A set of utility methods to ease working withParserandClause
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static StringgetBsn(Manifest manifest)static List<org.apache.felix.utils.manifest.Clause>getExports(Manifest manifest)Get the list of exports from the manifest.static StringgetHeader(String name, Manifest manifest)static List<org.apache.felix.utils.manifest.Clause>getImports(Manifest manifest)Get the list of imports from the manifest.static List<org.apache.felix.utils.manifest.Clause>getMandatoryImports(Manifest manifest)Get the list of non-optional imports from the manifest.static org.apache.felix.utils.version.VersionRangegetVersionRange(org.apache.felix.utils.manifest.Clause clause)static booleanisBundle(Manifest manifest)Check if the manifest contains the mandatory Bundle-Symbolic-Namestatic booleanisOptional(org.apache.felix.utils.manifest.Clause clause)Check if a given manifest clause represents an optional importstatic booleanmatches(org.apache.felix.utils.manifest.Clause requirement, org.apache.felix.utils.manifest.Clause export)
-
-
-
Method Detail
-
getImports
public static List<org.apache.felix.utils.manifest.Clause> getImports(Manifest manifest)
Get the list of imports from the manifest. If no imports have been defined, this method returns an empty list.- Parameters:
manifest- the manifest- Returns:
- the list of imports
-
getMandatoryImports
public static List<org.apache.felix.utils.manifest.Clause> getMandatoryImports(Manifest manifest)
Get the list of non-optional imports from the manifest.- Parameters:
manifest- the manifest- Returns:
- the list of non-optional imports
-
getExports
public static List<org.apache.felix.utils.manifest.Clause> getExports(Manifest manifest)
Get the list of exports from the manifest. If no exports have been defined, this method returns an empty list.- Parameters:
manifest- the manifest- Returns:
- the list of exports
-
isOptional
public static boolean isOptional(org.apache.felix.utils.manifest.Clause clause)
Check if a given manifest clause represents an optional import- Parameters:
clause- the manifest clause- Returns:
truefor an optional import,falsefor mandatory imports
-
isBundle
public static boolean isBundle(Manifest manifest)
Check if the manifest contains the mandatory Bundle-Symbolic-Name- Parameters:
manifest- the manifest- Returns:
trueif the manifest specifies a Bundle-Symbolic-Name
-
matches
public static boolean matches(org.apache.felix.utils.manifest.Clause requirement, org.apache.felix.utils.manifest.Clause export)
-
getVersionRange
public static org.apache.felix.utils.version.VersionRange getVersionRange(org.apache.felix.utils.manifest.Clause clause)
-
-