public class ModelArchiveWriter extends Object
Modifier and Type | Class and Description |
---|---|
static interface |
ModelArchiveWriter.ArtifactProvider |
Modifier and Type | Field and Description |
---|---|
static int |
ARCHIVE_VERSION
Current support version of the model archive.
|
static String |
ARTIFACTS_PREFIX
Artifacts prefix.
|
static String |
DEFAULT_EXTENSION
Default extension for model archives.
|
static String |
MANIFEST_HEADER
The manifest header marking an archive as a model archive.
|
static String |
MODEL_NAME
Model name.
|
Constructor and Description |
---|
ModelArchiveWriter() |
Modifier and Type | Method and Description |
---|---|
static JarOutputStream |
write(OutputStream out,
Model model,
Manifest baseManifest,
ModelArchiveWriter.ArtifactProvider provider)
Create a model archive.
|
public static final String MANIFEST_HEADER
public static final int ARCHIVE_VERSION
public static final String DEFAULT_EXTENSION
public static final String MODEL_NAME
public static final String ARTIFACTS_PREFIX
public static JarOutputStream write(OutputStream out, Model model, Manifest baseManifest, ModelArchiveWriter.ArtifactProvider provider) throws IOException
ZipOutputStream.close()
or ZipOutputStream.finish()
on the return output stream. The caller can add additional files through
the return stream.
In order to create an archive for a model, each feature in the model must
have a name and a version and the model must be valid, therefore ModelUtility.validateIncludingVersion(Model)
is called first. If the model is invalid an IOException
is thrown.out
- The output stream to write tomodel
- The model to writebaseManifest
- Optional base manifest used for creating the manifest.provider
- The artifact providerIOException
- If anything goes wrongCopyright © 2017 The Apache Software Foundation. All rights reserved.