|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.atlassian.plugin.osgi.util.OsgiHeaderUtil
public class OsgiHeaderUtil
Utilities to help create OSGi headers
| Constructor Summary | |
|---|---|
OsgiHeaderUtil()
|
|
| Method Summary | |
|---|---|
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 PluginInformation |
extractOsgiPluginInformation(Manifest manifest,
boolean requireVersion)
Extract a PluginInformation from the Manifest of a jar containing an OSGi bundle. |
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 Manifest |
getManifest(PluginArtifact pluginArtifact)
Extract the manifest of a PluginArtifact. |
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(File file)
Obtain the plugin key for a bundle in the given File. |
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 |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public OsgiHeaderUtil()
| Method Detail |
|---|
public static Set<String> findReferredPackageNames(List<HostComponentRegistration> registrations)
throws IOException
registrations - A list of host component registrations
IOException - If there are any problems scanning bytecode
public static Map<String,String> findReferredPackageVersions(List<HostComponentRegistration> registrations,
Map<String,String> packageVersions)
throws IOException
registrations - A list of host component registrations
IOException - 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 registrations
IOException - 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 registrations
IOException - If there are any problems scanning bytecodepublic static Map<String,Map<String,String>> parseHeader(String header)
header - The header line
public static String buildHeader(Map<String,Map<String,String>> values)
values - The header values
public static String buildHeader(String key,
Map<String,String> attrs)
key - The header valueattrs - The map of attributes
public 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 bundle
public static String getPluginKey(File file)
file - the file containing the bundle.
public static String getPluginKey(Manifest mf)
mf - The plugin jar manifest
public 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 null
IllegalArgumentException - if attribute is empty
public static String getNonEmptyAttribute(Manifest manifest,
String key)
manifest - key -
IllegalArgumentException - if attribute value is empty
public static String getAttributeWithoutValidation(Manifest manifest,
String key)
manifest - key -
@Internal
public static PluginInformation extractOsgiPluginInformation(Manifest manifest,
boolean requireVersion)
manifest - the manifest to parse.
public static Manifest getManifest(PluginArtifact pluginArtifact)
pluginArtifact - the plugin artifact who manifest is required.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||