Class LocalDistributionPackageImporterFactory
java.lang.Object
org.apache.sling.distribution.packaging.impl.importer.LocalDistributionPackageImporterFactory
- All Implemented Interfaces:
org.apache.sling.distribution.packaging.impl.DistributionPackageImporter
public class LocalDistributionPackageImporterFactory
extends Object
implements org.apache.sling.distribution.packaging.impl.DistributionPackageImporter
OSGi configuration factory for
LocalDistributionPackageImporters.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic @interface -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidimportPackage(@NotNull org.apache.sling.api.resource.ResourceResolver resourceResolver, @NotNull DistributionPackage distributionPackage) Imports the given distribution package into the underlying system@NotNull DistributionPackageInfoimportStream(@NotNull org.apache.sling.api.resource.ResourceResolver resourceResolver, @NotNull InputStream stream) Tries to convert anInputStreamto aDistributionPackageand then imports it into the underlying system
-
Constructor Details
-
LocalDistributionPackageImporterFactory
public LocalDistributionPackageImporterFactory()
-
-
Method Details
-
activate
-
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.DistributionPackageImporterImports the given distribution package into the underlying system- Specified by:
importPackagein interfaceorg.apache.sling.distribution.packaging.impl.DistributionPackageImporter- Parameters:
resourceResolver- - the resource resolver used to import the resourcesdistributionPackage- - 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.DistributionPackageImporterTries to convert anInputStreamto aDistributionPackageand then imports it into the underlying system- Specified by:
importStreamin interfaceorg.apache.sling.distribution.packaging.impl.DistributionPackageImporter- Parameters:
resourceResolver- - the resource resolver used to read the packagestream- theInputStreamof the package to be converted and imported- Returns:
- a
DistributionPackageInfoif the stream has been successfully converted and imported - Throws:
DistributionException- when the stream cannot be read as aDistributionPackageand imported
-