org.apache.sling.commons.osgi

## 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 Summary

Constructors
Constructor and Description
`BundleFileProcessor(File input, File outputFolder)`

### Method Summary

All Methods Instance Methods Abstract Methods Concrete Methods
`protected abstract String` `getTargetFilename(Manifest inputJarManifest)` Return the filename to use for the newly created bundle file
`File` `process()` Creates a new OSGi Bundle from a given bundle, processing its manifest using the processManifest method.
`protected abstract Manifest` `processManifest(Manifest originalManifest)` Process the bundle Manifest.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### BundleFileProcessor

    public BundleFileProcessor(File input,
                               File outputFolder)

### Method Detail

#### 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.