Class ArchiveWriter
java.lang.Object
org.apache.sling.feature.io.archive.ArchiveWriter
The feature archive writer can be used to create an archive based on a
feature model. The archive contains the feature model file and all artifacts
using a maven repository layout.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic JarOutputStream
write
(OutputStream out, Manifest baseManifest, ArtifactProvider provider, Feature... features) Create a feature model archive.
-
Field Details
-
VERSION_HEADER
The manifest header marking an archive as a feature archive.- See Also:
-
CONTENTS_HEADER
The manifest header listing the features in this archive.- See Also:
-
ARCHIVE_VERSION
public static final int ARCHIVE_VERSIONCurrent support version of the feature model archive.- See Also:
-
-
Constructor Details
-
ArchiveWriter
public ArchiveWriter()
-
-
Method Details
-
write
public static JarOutputStream write(OutputStream out, Manifest baseManifest, ArtifactProvider provider, Feature... features) throws IOException Create a feature model archive. The output stream will not be closed by this method. The caller must callZipOutputStream.close()
on the return output stream. The caller can add additional files through the return stream. However, the files should not be compressed (which is the default for the output stream). A feature model can be in different states: it might be a partial feature model, a complete feature model or an assembled feature model. This method takes the feature model as provided and only writes the listed bundles and artifacts of this feature model into the archive. In general, the best approach for sharing features is to archivecomplete
features.- Parameters:
out
- The output stream to write tobaseManifest
- Optional base manifest used for creating the manifest.provider
- The artifact providerfeatures
- The features model to archive- Returns:
- The jar output stream.
- Throws:
IOException
- If anything goes wrong
-