org.apache.sling.commons.osgi

## Class BSNRenamer

- java.lang.Object
- - org.apache.sling.commons.osgi.BundleFileProcessor
  - - org.apache.sling.commons.osgi.BSNRenamer

    public class BSNRenamer
    extends BundleFileProcessor

Processes a bundle file by changing its Bundle-SymbolicName. The original BSN is copied to a an `X_ORIG_BSN` header, to allow users to find out what happened.

Since:
  2.4

### Field Summary

Fields
`static String` `BUNDLE_SYMBOLIC_NAME`
`static String` `BUNDLE_VERSION`
`static String` `X_ORIG_BSN`

### Constructor Summary

Constructors
Constructor and Description
`BSNRenamer(File input, File outputFolder, String newBSN)`

### Method Summary

All Methods Instance Methods Concrete Methods
`protected String` `getTargetFilename(Manifest inputJarManifest)` Return the filename to use for the newly created bundle file
`protected Manifest` `processManifest(Manifest inputMF)` Process the bundle Manifest.

### Methods inherited from class org.apache.sling.commons.osgi.BundleFileProcessor

`process`

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

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

### Field Detail

#### BUNDLE_SYMBOLIC_NAME

    public static final String BUNDLE_SYMBOLIC_NAME

See Also:
  Constant Field Values

#### X_ORIG_BSN

    public static final String X_ORIG_BSN

See Also:
  Constant Field Values

#### BUNDLE_VERSION

    public static final String BUNDLE_VERSION

See Also:
  Constant Field Values

### Constructor Detail

#### BSNRenamer

    public BSNRenamer(File input,
                      File outputFolder,
                      String newBSN)

### Method Detail

#### processManifest

    protected Manifest processManifest(Manifest inputMF)

Description copied from class: `BundleFileProcessor`
Process the bundle Manifest. Can return the original one if no changes are needed.

Specified by:
  `processManifest` in class `BundleFileProcessor`
Parameters:
  `inputMF` - The manifest to process
Returns:
  The processed manifest.

#### getTargetFilename

    protected String getTargetFilename(Manifest inputJarManifest)

Description copied from class: `BundleFileProcessor`
Return the filename to use for the newly created bundle file

Specified by:
  `getTargetFilename` in class `BundleFileProcessor`
Parameters:
  `inputJarManifest` - The manifest
Returns:
  The filename