public class OsgiHeaderUtil extends Object
| Constructor and Description |
|---|
OsgiHeaderUtil() |
| Modifier and Type | Method and Description |
|---|---|
static String |
buildHeader(Map<String,Map<String,String>> values)
Builds the header string from a map
|
static String |
buildHeader(String key,
Map<String,String> attrs)
Builds the header string from a map
|
static Set<String> |
findReferredPackageNames(List<HostComponentRegistration> registrations)
Finds all referred packages for host component registrations by scanning their declared interfaces' bytecode.
|
static String |
findReferredPackages(List<HostComponentRegistration> registrations)
Deprecated.
Since 2.7.0, use
findReferredPackageNames(java.util.List) instead. |
static String |
findReferredPackages(List<HostComponentRegistration> registrations,
Map<String,String> packageVersions)
Deprecated.
Since 2.7.0, use
findReferredPackageVersions(java.util.List, java.util.Map) instead. |
static Map<String,String> |
findReferredPackageVersions(List<HostComponentRegistration> registrations,
Map<String,String> packageVersions)
Finds all referred packages for host component registrations by scanning their declared interfaces' bytecode.
|
static String |
generatePackageVersionString(Map<String,String> packages)
Generate package version string such as "com.abc;version=1.2,com.atlassian".
|
static String |
getAttributeWithoutValidation(Manifest manifest,
String key)
Extract the attribute from manifest(no-validations)
|
static String |
getNonEmptyAttribute(Manifest manifest,
String key)
Extract the attribute from manifest and validate if it's not empty
|
static String |
getPluginKey(org.osgi.framework.Bundle bundle)
Gets the plugin key from the bundle
WARNING: shamelessly copied at
PluginBundleUtils, which can't use
this class due to creating a cyclic build dependency. |
static String |
getPluginKey(Manifest mf)
Gets the plugin key from the jar manifest
|
static String |
getValidatedAttribute(Manifest manifest,
String key)
Extract the attribute from manifest and validate it's not null and not empty
|
static Map<String,Map<String,String>> |
parseHeader(String header)
Parses an OSGi header line into a map structure
|
public static Set<String> findReferredPackageNames(List<HostComponentRegistration> registrations) throws IOException
registrations - A list of host component registrationsIOException - If there are any problems scanning bytecodepublic static Map<String,String> findReferredPackageVersions(List<HostComponentRegistration> registrations, Map<String,String> packageVersions) throws IOException
registrations - A list of host component registrationsIOException - If there are any problems scanning bytecode@Deprecated public static String findReferredPackages(List<HostComponentRegistration> registrations) throws IOException
findReferredPackageNames(java.util.List) instead.registrations - A list of host component registrationsIOException - If there are any problems scanning bytecode@Deprecated public static String findReferredPackages(List<HostComponentRegistration> registrations, Map<String,String> packageVersions) throws IOException
findReferredPackageVersions(java.util.List, java.util.Map) instead.registrations - A list of host component registrationsIOException - If there are any problems scanning bytecodepublic static Map<String,Map<String,String>> parseHeader(String header)
header - The header linepublic static String buildHeader(Map<String,Map<String,String>> values)
values - The header valuespublic static String buildHeader(String key, Map<String,String> attrs)
key - The header valueattrs - The map of attributespublic static String getPluginKey(org.osgi.framework.Bundle bundle)
PluginBundleUtils, which can't use
this class due to creating a cyclic build dependency. Ensure these two implementations are in sync.
This method shouldn't be used directly. Instead consider consuming the PluginRetrievalService.bundle - The plugin bundlepublic static String getPluginKey(Manifest mf)
mf - The plugin jar manifestpublic static String generatePackageVersionString(Map<String,String> packages)
packages - map of packagename->version.public static String getValidatedAttribute(Manifest manifest, String key)
manifest - key - NullPointerException - if attribute value is nullIllegalArgumentException - if attribute is emptypublic static String getNonEmptyAttribute(Manifest manifest, String key)
manifest - key - IllegalArgumentException - if attribute value is emptyCopyright © 2014 Atlassian. All rights reserved.