Package org.apache.sling.distribution.packaging.impl.importer

## Class LocalDistributionPackageImporter

- java.lang.Object
- - org.apache.sling.distribution.packaging.impl.importer.LocalDistributionPackageImporter

All Implemented Interfaces:
  `org.apache.sling.distribution.packaging.impl.DistributionPackageImporter`

    public class LocalDistributionPackageImporter
    extends Object
    implements org.apache.sling.distribution.packaging.impl.DistributionPackageImporter

`DistributionPackageImporter` implementation which imports a `DistributionPackage` locally.

### Constructor Summary

Constructors
`LocalDistributionPackageImporter​(String name, org.apache.sling.distribution.event.impl.DistributionEventFactory eventFactory, DistributionPackageBuilder packageBuilder)`

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `importPackage​(@NotNull org.apache.sling.api.resource.ResourceResolver resourceResolver, @NotNull DistributionPackage distributionPackage)` Imports the given distribution package into the underlying system
`@NotNull DistributionPackageInfo` `importStream​(@NotNull org.apache.sling.api.resource.ResourceResolver resourceResolver, @NotNull InputStream stream)` Tries to convert an `InputStream` to a `DistributionPackage` and then imports it into the underlying system

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

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

### Constructor Detail

#### LocalDistributionPackageImporter

    public LocalDistributionPackageImporter​(String name,
                                            org.apache.sling.distribution.event.impl.DistributionEventFactory eventFactory,
                                            DistributionPackageBuilder packageBuilder)

### Method Detail

#### importPackage

    public void importPackage​(@NotNull
                              @NotNull org.apache.sling.api.resource.ResourceResolver resourceResolver,
                              @NotNull
                              @NotNull DistributionPackage distributionPackage)
                       throws DistributionException

Description copied from interface: `org.apache.sling.distribution.packaging.impl.DistributionPackageImporter`
Imports the given distribution package into the underlying system

Specified by:
  `importPackage` in interface `org.apache.sling.distribution.packaging.impl.DistributionPackageImporter`
Parameters:
  `resourceResolver` - - the resource resolver used to import the resources
  `distributionPackage` - - the package to be imported
Throws:
  `DistributionException` - if any error occurs during import

#### importStream

    @NotNull
    public @NotNull DistributionPackageInfo importStream​(@NotNull
                                                         @NotNull org.apache.sling.api.resource.ResourceResolver resourceResolver,
                                                         @NotNull
                                                         @NotNull InputStream stream)
                                                  throws DistributionException

Description copied from interface: `org.apache.sling.distribution.packaging.impl.DistributionPackageImporter`
Tries to convert an `InputStream` to a `DistributionPackage` and then imports it into the underlying system

Specified by:
  `importStream` in interface `org.apache.sling.distribution.packaging.impl.DistributionPackageImporter`
Parameters:
  `resourceResolver` - - the resource resolver used to read the package
  `stream` - the `InputStream` of the package to be converted and imported
Returns:
  a `DistributionPackageInfo` if the stream has been successfully converted and imported
Throws:
  `DistributionException` - when the stream cannot be read as a `DistributionPackage` and imported