Package org.apache.sling.feature.cpconverter

## Class ContentPackage2FeatureModelConverter

- java.lang.Object
- - org.apache.sling.feature.cpconverter.vltpkg.BaseVaultPackageScanner
  - - org.apache.sling.feature.cpconverter.ContentPackage2FeatureModelConverter

All Implemented Interfaces:
  `Closeable`, `AutoCloseable`

    public class ContentPackage2FeatureModelConverter
    extends BaseVaultPackageScanner
    implements Closeable

### Nested Class Summary

Nested Classes
`static class` `ContentPackage2FeatureModelConverter.PackagePolicy`
`static class` `ContentPackage2FeatureModelConverter.RunModePolicy`
`static class` `ContentPackage2FeatureModelConverter.SlingInitialContentPolicy`

### Field Summary

Fields
`static String` `PACKAGE_CLASSIFIER`
`static String` `ZIP_TYPE`

### Fields inherited from class org.apache.sling.feature.cpconverter.vltpkg.BaseVaultPackageScanner

`logger, packageManager, strictValidation`

### Constructor Summary

Constructors
`ContentPackage2FeatureModelConverter()`
`ContentPackage2FeatureModelConverter​(boolean strictValidation, @NotNull ContentPackage2FeatureModelConverter.SlingInitialContentPolicy slingInitialContentPolicy)`
`ContentPackage2FeatureModelConverter​(boolean strictValidation, @NotNull ContentPackage2FeatureModelConverter.SlingInitialContentPolicy slingInitialContentPolicy, boolean disablePackageTypeRecalculation)`
`ContentPackage2FeatureModelConverter​(boolean strictValidation, @NotNull ContentPackage2FeatureModelConverter.SlingInitialContentPolicy slingInitialContentPolicy, boolean disablePackageTypeRecalculation, @NotNull ContentPackage2FeatureModelConverter.RunModePolicy runModePolicy)`

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`protected void` `addCdnPattern​(@NotNull Pattern cndPattern)`
`void` `cleanup()`
`void` `close()`
`void` `convert​(@NotNull File... contentPackages)`
`void` `deployPackages()`
`protected @NotNull Collection<org.apache.jackrabbit.vault.packaging.VaultPackage>` `firstPass​(@NotNull File... contentPackages)`
`@NotNull AclManager` `getAclManager()`
`@Nullable ArtifactsDeployer` `getArtifactsDeployer()`
`List<VaultPackageAssembler>` `getAssemblers()`
`@Nullable FeaturesManager` `getFeaturesManager()`
`@Nullable IndexManager` `getIndexManager()`
`@NotNull VaultPackageAssembler` `getMainPackageAssembler()`
`ContentPackage2FeatureModelConverter.RunModePolicy` `getRunModePolicy()`
`@NotNull File` `getTempDirectory()`
`boolean` `hasMainPackageAssembler()`
`boolean` `isSubContentPackageIncluded​(@NotNull String path)`
`protected void` `onFile​(@NotNull String entryPath, @NotNull org.apache.jackrabbit.vault.fs.io.Archive archive, @NotNull org.apache.jackrabbit.vault.fs.io.Archive.Entry entry, String runMode)`
`void` `processSubPackage​(@NotNull String path, @Nullable String runMode, @NotNull org.apache.jackrabbit.vault.packaging.VaultPackage vaultPackage, boolean isEmbeddedPackage)`
`@NotNull ContentPackage2FeatureModelConverter` `setAclManager​(@NotNull AclManager aclManager)`
`@NotNull ContentPackage2FeatureModelConverter` `setBundlesDeployer​(@NotNull ArtifactsDeployer bundlesDeployer)`
`ContentPackage2FeatureModelConverter` `setBundleSlingInitialContentExtractor​(BundleSlingInitialContentExtractor bundleSlingInitialContentExtractor)`
`@NotNull ContentPackage2FeatureModelConverter` `setContentTypePackagePolicy​(@NotNull ContentPackage2FeatureModelConverter.PackagePolicy contentTypePackagePolicy)`
`@NotNull ContentPackage2FeatureModelConverter` `setEmitter​(@NotNull PackagesEventsEmitter emitter)`
`@NotNull ContentPackage2FeatureModelConverter` `setEntryHandlersManager​(@Nullable EntryHandlersManager handlersManager)`
`@NotNull ContentPackage2FeatureModelConverter` `setFailOnMixedPackages​(boolean failOnMixedPackages)`
`@NotNull ContentPackage2FeatureModelConverter` `setFeaturesManager​(@NotNull FeaturesManager featuresManager)`
`@NotNull ContentPackage2FeatureModelConverter` `setIndexManager​(IndexManager indexManager)`
`@NotNull ContentPackage2FeatureModelConverter` `setMainPackageAssembler​(@NotNull VaultPackageAssembler assembler)`
`@NotNull ContentPackage2FeatureModelConverter` `setRemoveInstallHooks​(boolean removeInstallHook)`
`@NotNull ContentPackage2FeatureModelConverter` `setResourceFilter​(@Nullable ResourceFilter resourceFilter)`
`@NotNull ContentPackage2FeatureModelConverter` `setRunModePolicy​(@NotNull ContentPackage2FeatureModelConverter.RunModePolicy runModePolicy)`
`@NotNull ContentPackage2FeatureModelConverter` `setUnreferencedArtifactsDeployer​(@NotNull ArtifactsDeployer unreferencedArtifactsDeployer)`
`static @NotNull org.apache.sling.feature.ArtifactId` `toArtifactId​(@NotNull org.apache.jackrabbit.vault.packaging.PackageId packageId, @NotNull File file)`

### Methods inherited from class org.apache.sling.feature.cpconverter.vltpkg.BaseVaultPackageScanner

`onDirectory, open, traverse, traverse`

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

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

### Field Detail

#### ZIP_TYPE

    public static final String ZIP_TYPE

See Also:
  Constant Field Values

#### PACKAGE_CLASSIFIER

    public static final String PACKAGE_CLASSIFIER

See Also:
  Constant Field Values

### Constructor Detail

#### ContentPackage2FeatureModelConverter

    public ContentPackage2FeatureModelConverter()
                                         throws IOException

Throws:
  `IOException`

#### ContentPackage2FeatureModelConverter

    public ContentPackage2FeatureModelConverter​(boolean strictValidation,
                                                @NotNull
                                                @NotNull ContentPackage2FeatureModelConverter.SlingInitialContentPolicy slingInitialContentPolicy)
                                         throws IOException

Throws:
  `IOException`

#### ContentPackage2FeatureModelConverter

    public ContentPackage2FeatureModelConverter​(boolean strictValidation,
                                                @NotNull
                                                @NotNull ContentPackage2FeatureModelConverter.SlingInitialContentPolicy slingInitialContentPolicy,
                                                boolean disablePackageTypeRecalculation)
                                         throws IOException

Throws:
  `IOException`

#### ContentPackage2FeatureModelConverter

    public ContentPackage2FeatureModelConverter​(boolean strictValidation,
                                                @NotNull
                                                @NotNull ContentPackage2FeatureModelConverter.SlingInitialContentPolicy slingInitialContentPolicy,
                                                boolean disablePackageTypeRecalculation,
                                                @NotNull
                                                @NotNull ContentPackage2FeatureModelConverter.RunModePolicy runModePolicy)
                                         throws IOException

Throws:
  `IOException`

### Method Detail

#### setEntryHandlersManager

    @NotNull
    public @NotNull ContentPackage2FeatureModelConverter setEntryHandlersManager​(@Nullable
                                                                                 @Nullable EntryHandlersManager handlersManager)

#### getFeaturesManager

    @Nullable
    public @Nullable FeaturesManager getFeaturesManager()

#### setFeaturesManager

    @NotNull
    public @NotNull ContentPackage2FeatureModelConverter setFeaturesManager​(@NotNull
                                                                            @NotNull FeaturesManager featuresManager)

#### setResourceFilter

    @NotNull
    public @NotNull ContentPackage2FeatureModelConverter setResourceFilter​(@Nullable
                                                                           @Nullable ResourceFilter resourceFilter)

#### getArtifactsDeployer

    @Nullable
    public @Nullable ArtifactsDeployer getArtifactsDeployer()

#### setBundlesDeployer

    @NotNull
    public @NotNull ContentPackage2FeatureModelConverter setBundlesDeployer​(@NotNull
                                                                            @NotNull ArtifactsDeployer bundlesDeployer)

#### setUnreferencedArtifactsDeployer

    @NotNull
    public @NotNull ContentPackage2FeatureModelConverter setUnreferencedArtifactsDeployer​(@NotNull
                                                                                          @NotNull ArtifactsDeployer unreferencedArtifactsDeployer)

#### getAclManager

    @NotNull
    public @NotNull AclManager getAclManager()

#### setAclManager

    @NotNull
    public @NotNull ContentPackage2FeatureModelConverter setAclManager​(@NotNull
                                                                       @NotNull AclManager aclManager)

#### hasMainPackageAssembler

    public boolean hasMainPackageAssembler()

#### getMainPackageAssembler

    @NotNull
    public @NotNull VaultPackageAssembler getMainPackageAssembler()

#### setMainPackageAssembler

    @NotNull
    public @NotNull ContentPackage2FeatureModelConverter setMainPackageAssembler​(@NotNull
                                                                                 @NotNull VaultPackageAssembler assembler)

#### setEmitter

    @NotNull
    public @NotNull ContentPackage2FeatureModelConverter setEmitter​(@NotNull
                                                                    @NotNull PackagesEventsEmitter emitter)

#### setContentTypePackagePolicy

    @NotNull
    public @NotNull ContentPackage2FeatureModelConverter setContentTypePackagePolicy​(@NotNull
                                                                                     @NotNull ContentPackage2FeatureModelConverter.PackagePolicy contentTypePackagePolicy)

#### setFailOnMixedPackages

    @NotNull
    public @NotNull ContentPackage2FeatureModelConverter setFailOnMixedPackages​(boolean failOnMixedPackages)

#### setRemoveInstallHooks

    @NotNull
    public @NotNull ContentPackage2FeatureModelConverter setRemoveInstallHooks​(boolean removeInstallHook)

#### setRunModePolicy

    @NotNull
    public @NotNull ContentPackage2FeatureModelConverter setRunModePolicy​(@NotNull
                                                                          @NotNull ContentPackage2FeatureModelConverter.RunModePolicy runModePolicy)

#### getRunModePolicy

    public ContentPackage2FeatureModelConverter.RunModePolicy getRunModePolicy()

#### getIndexManager

    @Nullable
    public @Nullable IndexManager getIndexManager()

#### setIndexManager

    @NotNull
    public @NotNull ContentPackage2FeatureModelConverter setIndexManager​(IndexManager indexManager)

#### getTempDirectory

    @NotNull
    public @NotNull File getTempDirectory()

#### cleanup

    public void cleanup()
                 throws IOException

Throws:
  `IOException`

#### convert

    public void convert​(@NotNull
                        @NotNull File... contentPackages)
                 throws IOException,
                        ConverterException

Throws:
  `IOException`
  `ConverterException`

#### firstPass

    @NotNull
    protected @NotNull Collection<org.apache.jackrabbit.vault.packaging.VaultPackage> firstPass​(@NotNull
                                                                                                @NotNull File... contentPackages)
                                                                                         throws IOException,
                                                                                                ConverterException

Throws:
  `IOException`
  `ConverterException`

#### processSubPackage

    public void processSubPackage​(@NotNull
                                  @NotNull String path,
                                  @Nullable
                                  @Nullable String runMode,
                                  @NotNull
                                  @NotNull org.apache.jackrabbit.vault.packaging.VaultPackage vaultPackage,
                                  boolean isEmbeddedPackage)
                           throws IOException,
                                  ConverterException

Throws:
  `IOException`
  `ConverterException`

#### deployPackages

    public void deployPackages()

#### isSubContentPackageIncluded

    public boolean isSubContentPackageIncluded​(@NotNull
                                               @NotNull String path)

#### setBundleSlingInitialContentExtractor

    public ContentPackage2FeatureModelConverter setBundleSlingInitialContentExtractor​(BundleSlingInitialContentExtractor bundleSlingInitialContentExtractor)

#### onFile

    protected void onFile​(@NotNull
                          @NotNull String entryPath,
                          @NotNull
                          @NotNull org.apache.jackrabbit.vault.fs.io.Archive archive,
                          @NotNull
                          @NotNull org.apache.jackrabbit.vault.fs.io.Archive.Entry entry,
                          String runMode)
                   throws IOException,
                          ConverterException

Overrides:
  `onFile` in class `BaseVaultPackageScanner`
Throws:
  `IOException`
  `ConverterException`

#### toArtifactId

    @NotNull
    public static @NotNull org.apache.sling.feature.ArtifactId toArtifactId​(@NotNull
                                                                            @NotNull org.apache.jackrabbit.vault.packaging.PackageId packageId,
                                                                            @NotNull
                                                                            @NotNull File file)

#### addCdnPattern

    protected void addCdnPattern​(@NotNull
                                 @NotNull Pattern cndPattern)

Overrides:
  `addCdnPattern` in class `BaseVaultPackageScanner`

#### close

    public void close()
               throws IOException

Specified by:
  `close` in interface `AutoCloseable`
Specified by:
  `close` in interface `Closeable`
Throws:
  `IOException`

#### getAssemblers

    public List<VaultPackageAssembler> getAssemblers()