Class BundleFileProcessor

java.lang.Object
org.apache.sling.commons.osgi.BundleFileProcessor
Direct Known Subclasses:
BSNRenamer

public abstract class BundleFileProcessor extends Object
The BundleFileProcessor can transform a bundle Manifest by creating a modified copy of the bundle file.
Since:
2.4
  • Constructor Details

    • BundleFileProcessor

      public BundleFileProcessor(File input, File outputFolder)
  • Method Details

    • processManifest

      protected abstract Manifest processManifest(Manifest originalManifest)
      Process the bundle Manifest. Can return the original one if no changes are needed.
      Parameters:
      originalManifest - The manifest to process
      Returns:
      The processed manifest.
    • getTargetFilename

      protected abstract String getTargetFilename(Manifest inputJarManifest)
      Return the filename to use for the newly created bundle file
      Parameters:
      inputJarManifest - The manifest
      Returns:
      The filename
    • process

      public File process() throws IOException
      Creates a new OSGi Bundle from a given bundle, processing its manifest using the processManifest method.
      Returns:
      The new bundle file
      Throws:
      IOException - If something goes wrong reading or writing.