org.apache.aries.application.utils.manifest
Class ManifestDefaultsInjector

java.lang.Object
  extended by org.apache.aries.application.utils.manifest.ManifestDefaultsInjector

public class ManifestDefaultsInjector
extends Object


Constructor Summary
ManifestDefaultsInjector()
           
 
Method Summary
static boolean updateManifest(Manifest mf, String appName, File zip)
          Quick adapter to update a Manifest, using content of a Zip File.
static boolean updateManifest(Manifest mf, String appName, IDirectory appDir)
          Tests the supplied manifest for the presence of expected attributes, and where missing, adds them, and defaults their values appropriately.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ManifestDefaultsInjector

public ManifestDefaultsInjector()
Method Detail

updateManifest

public static boolean updateManifest(Manifest mf,
                                     String appName,
                                     File zip)
Quick adapter to update a Manifest, using content of a Zip File.

This is really a wrapper of updateManifest(Manifest,String,IDirectory), with the IDirectory being being created from the Zip File. This method avoids other Bundles requiring IDirectory solely for calling updateManifest.

Parameters:
mf - Manifest to be updated
appName - The name to use for this app, if the name contains a '_' char then the portion after the '_' is used, if possible, as the application version.
zip - Content to use for application.
Returns:
true if manifest modified, false otherwise.

updateManifest

public static boolean updateManifest(Manifest mf,
                                     String appName,
                                     IDirectory appDir)
Tests the supplied manifest for the presence of expected attributes, and where missing, adds them, and defaults their values appropriately.

Parameters:
mf - The manifest to test & update if needed.
appName - The name to use for this app, if the name contains a '_' char then the portion after the '_' is used, if possible, as the application version.
appDir - The IDirectory to scan to build application content property
Returns:
true if manifest modified, false otherwise.


Copyright © 2009-2011 The Apache Software Foundation. All Rights Reserved.