public class PluginConverterImpl extends Object implements PluginConverter
Modifier and Type | Field and Description |
---|---|
static boolean |
DEBUG |
static String |
FRAGMENT_MANIFEST |
static String |
GENERATED_FROM |
static String |
MANIFEST_TYPE_ATTRIBUTE |
static byte |
MANIFEST_TYPE_BUNDLE
bundle manifest type bundle (META-INF/MANIFEST.MF)
|
static byte |
MANIFEST_TYPE_FRAGMENT
bundle manifest type fragment (fragment.xml)
|
static byte |
MANIFEST_TYPE_JAR
bundle manifest type jared bundle
|
static byte |
MANIFEST_TYPE_PLUGIN
bundle manifest type plugin (plugin.xml)
|
static byte |
MANIFEST_TYPE_UNKNOWN
bundle manifest type unknown
|
protected static String |
PI_BOOT |
protected static String |
PI_RUNTIME |
protected static String |
PI_RUNTIME_COMPATIBILITY |
static String |
PLUGIN_MANIFEST |
Constructor and Description |
---|
PluginConverterImpl(FrameworkAdaptor adaptor,
BundleContext context) |
Modifier and Type | Method and Description |
---|---|
Dictionary<String,String> |
convertManifest(File pluginBaseLocation,
boolean compatibility,
String targetVersion,
boolean analyseJars,
Dictionary<String,String> devProps)
Converts a plug-in/fragment manifest at the given source base location (a directory or jar file) and
generates a corresponding bundle manifest returned as a dictionary.
|
File |
convertManifest(File pluginBaseLocation,
File bundleManifestLocation,
boolean compatibilityManifest,
String targetVersion,
boolean analyseJars,
Dictionary<String,String> devProps)
Converts a plug-in/fragment manifest at the given source base location (a directory or jar file) and
generates a corresponding bundle manifest at the given default target location (a file).
|
protected void |
fillManifest(boolean compatibilityManifest,
boolean analyseJars) |
static PluginConverterImpl |
getDefault() |
static long |
getTimeStamp(File pluginLocation,
byte manifestType) |
static boolean |
upToDate(File generationLocation,
File pluginLocation,
byte manifestType) |
void |
writeManifest(File generationLocation,
Dictionary<String,String> manifestToWrite,
boolean compatibilityManifest)
Construct a bundle manifest file from the given dictionary and write it out to the
specified location in the file system.
|
public static boolean DEBUG
public static final byte MANIFEST_TYPE_UNKNOWN
public static final byte MANIFEST_TYPE_BUNDLE
public static final byte MANIFEST_TYPE_PLUGIN
public static final byte MANIFEST_TYPE_FRAGMENT
public static final byte MANIFEST_TYPE_JAR
public static final String FRAGMENT_MANIFEST
public static final String GENERATED_FROM
public static final String MANIFEST_TYPE_ATTRIBUTE
protected static final String PI_RUNTIME
protected static final String PI_BOOT
protected static final String PI_RUNTIME_COMPATIBILITY
public static final String PLUGIN_MANIFEST
public PluginConverterImpl(FrameworkAdaptor adaptor, BundleContext context)
public static PluginConverterImpl getDefault()
protected void fillManifest(boolean compatibilityManifest, boolean analyseJars)
public void writeManifest(File generationLocation, Dictionary<String,String> manifestToWrite, boolean compatibilityManifest) throws PluginConversionException
PluginConverter
If the compatibilityManifest
parameter is true
then
the generated manifest will include the necessary headers to all the manifest to be
run in backwards compatibility mode.
writeManifest
in interface PluginConverter
generationLocation
- the location for the bundle manifest to be writtenmanifestToWrite
- the dictionary to write into generationLocation filecompatibilityManifest
- a boolean indicating if the file should contain headers to allow
running in backward compatibility modePluginConversionException
- if an error occurs while writing the given manifestpublic static boolean upToDate(File generationLocation, File pluginLocation, byte manifestType)
public static long getTimeStamp(File pluginLocation, byte manifestType)
public Dictionary<String,String> convertManifest(File pluginBaseLocation, boolean compatibility, String targetVersion, boolean analyseJars, Dictionary<String,String> devProps) throws PluginConversionException
PluginConverter
convertManifest
in interface PluginConverter
pluginBaseLocation
- the base location for the plug-in/fragment manifest to be converted
(a directory or jar file, e.g. the plug-in install location)compatibility
- a boolean indicating if the manifest should contain headers to run
in backward compatibilitytargetVersion
- a string indicating the version of the runtime for which the manifest generated is targetedanalyseJars
- a boolean indicating if the code jars of the given plugin must be analysed. When set to false the Export-Package header will not be set in the bundle manifest.devProps
- a dictionary of development time classpath properties. The dictionary contains a mapping from plugin id to development
time classpath. A value of null
indicates that the default development time classpath properties will be used.null
otherwisePluginConversionException
- if an error occurs while converting the manifestpublic File convertManifest(File pluginBaseLocation, File bundleManifestLocation, boolean compatibilityManifest, String targetVersion, boolean analyseJars, Dictionary<String,String> devProps) throws PluginConversionException
PluginConverter
convertManifest
in interface PluginConverter
pluginBaseLocation
- the base location for the plug-in/fragment manifest to be converted
(a directory or jar file, e.g. the plug-in install location)bundleManifestLocation
- the location for the bundle manifest to be generated
(including the file name).compatibilityManifest
- a boolean indicating if the manifest should contain headers to run
in backward compatibilitytargetVersion
- a string indicating the version of the runtime for which the manifest generated is targetedanalyseJars
- a boolean indicating if the code jars of the given plugin must be analysed. When set to false the Export-Package header will not be set in the bundle manifest.devProps
- a dictionary of development time classpath properties. The dictionary contains a mapping from plugin id to development
time classpath. A value of null
indicates that the default development time classpath properties will be used.null
otherwise.PluginConversionException
- if an error occurs while converting the manifestCopyright © 2007–2018 The Apache Software Foundation. All rights reserved.