Package org.nuxeo.connect.update.util
Class PackageBuilder
- java.lang.Object
-
- org.nuxeo.connect.update.util.PackageBuilder
-
public class PackageBuilder extends Object
Build an XML representation of a package.- Author:
- Bogdan Stefanescu
-
-
Field Summary
Fields Modifier and Type Field Description protected List<org.nuxeo.connect.update.PackageDependency>
conflicts
protected org.nuxeo.connect.update.model.PackageDefinition
def
protected List<org.nuxeo.connect.update.PackageDependency>
dependencies
protected LinkedHashMap<String,InputStream>
entries
protected List<FormDefinition>
installForms
protected List<org.nuxeo.connect.update.PackageDependency>
optionalDependencies
protected List<String>
platforms
protected List<org.nuxeo.connect.update.PackageDependency>
provides
protected List<FormDefinition>
uninstallForms
protected List<FormDefinition>
validationForms
-
Constructor Summary
Constructors Constructor Description PackageBuilder()
-
Method Summary
-
-
-
Field Detail
-
def
protected final org.nuxeo.connect.update.model.PackageDefinition def
-
installForms
protected final List<FormDefinition> installForms
-
uninstallForms
protected final List<FormDefinition> uninstallForms
-
validationForms
protected final List<FormDefinition> validationForms
-
dependencies
protected final List<org.nuxeo.connect.update.PackageDependency> dependencies
-
optionalDependencies
protected final List<org.nuxeo.connect.update.PackageDependency> optionalDependencies
-
conflicts
protected final List<org.nuxeo.connect.update.PackageDependency> conflicts
-
provides
protected final List<org.nuxeo.connect.update.PackageDependency> provides
-
entries
protected final LinkedHashMap<String,InputStream> entries
-
-
Method Detail
-
name
public PackageBuilder name(String name)
-
version
public PackageBuilder version(org.nuxeo.connect.update.Version version)
-
version
public PackageBuilder version(String version)
-
type
public PackageBuilder type(String type)
-
type
public PackageBuilder type(org.nuxeo.connect.update.PackageType type)
-
title
public PackageBuilder title(String title)
-
description
public PackageBuilder description(String description)
-
classifier
public PackageBuilder classifier(String classifier)
-
vendor
public PackageBuilder vendor(String vendor)
-
installer
public PackageBuilder installer(org.nuxeo.connect.update.model.TaskDefinition task)
-
installer
public PackageBuilder installer(String type, boolean restart)
-
uninstaller
public PackageBuilder uninstaller(org.nuxeo.connect.update.model.TaskDefinition task)
-
uninstaller
public PackageBuilder uninstaller(String type, boolean restart)
-
hotReloadSupport
public PackageBuilder hotReloadSupport(boolean hotReloadSupport)
-
requireTermsAndConditionsAcceptance
public PackageBuilder requireTermsAndConditionsAcceptance(boolean requireTermsAndConditionsAcceptance)
-
validator
public PackageBuilder validator(String validator)
-
platform
public PackageBuilder platform(String platform)
-
platformName
public PackageBuilder platformName(String platformName)
-
platformRange
public PackageBuilder platformRange(String platformRange)
-
dependency
public PackageBuilder dependency(String expr)
-
optionalDependency
public PackageBuilder optionalDependency(String expr)
- Since:
- 6.0-HF33
-
conflict
public PackageBuilder conflict(String expr)
-
provide
public PackageBuilder provide(String expr)
-
addInstallForm
public PackageBuilder addInstallForm(FormDefinition form)
-
addUninstallForm
public PackageBuilder addUninstallForm(FormDefinition form)
-
addValidationForm
public PackageBuilder addValidationForm(FormDefinition form)
-
addLicense
public PackageBuilder addLicense(String content)
-
addLicense
public PackageBuilder addLicense(InputStream in)
-
addInstallScript
public PackageBuilder addInstallScript(String content)
-
addInstallScript
public PackageBuilder addInstallScript(InputStream in)
-
addUninstallScript
public PackageBuilder addUninstallScript(String content)
-
addUninstallScript
public PackageBuilder addUninstallScript(InputStream in)
-
addTermsAndConditions
public PackageBuilder addTermsAndConditions(String content)
-
addTermsAndConditions
public PackageBuilder addTermsAndConditions(InputStream in)
-
addEntry
public PackageBuilder addEntry(String path, InputStream in)
The entry content will be copied into the zip at build time and the given input stream will be closed. (event if an exception occurs) - so you don't need to handle stream closing.
-
buildManifest
public String buildManifest()
-
build
public File build() throws IOException
- Throws:
IOException
-
addForms
protected void addForms(List<FormDefinition> formDefs, String path, ZipOutputStream zout) throws IOException
- Throws:
IOException
-
-