public interface InstallerManager extends Manager
This manager is used to register and create the services that are used to manage the creation and the execution of installers. An installer is a file called bundle that is composed of a set packages.
A package has some information that is defined by the PackageInfo
class and is composed of a set of attributes. One of these attributes, the
type, denotes if the package is a plugin, theme, translation, etc.
In practice a bundle is just a compressed zip file that has a compressed zip file for every package to install. The structure of a bundle file with two packages of type plugin could be:
- bundle (compressed file) - org.gvsig.plugin1-1_0_0-23 (compressed file) - org.gvsig.plugin1 - package.info - org.gvsig.plugin2-2_0_1-35 (compressed file) - org.gvsig.plugin1 - package.info
bundle is the compressed file that contains a zip entry for every package to install. The name of the zip entry follows next pattern:
[package code]-[version]-[build]
Every zip entry contains a main folder inside that contains all the package
files that are used in the installation process. Depending of the type of
packages, the information inside this folder can be different, but all the
types of packages have to have the package.infofile that has all the
package information. To see the package.info description see
PackageInfo
.
The services that offers this managers are basically two: the creation of bundles for just one package of plugin type and a service for the installation of packages from a bundle.
Modifier and Type | Interface and Description |
---|---|
static interface |
InstallerManager.ARCH
Supported architecture default values.
|
static interface |
InstallerManager.JVM
Supported Java virtual machine version default values.
|
static interface |
InstallerManager.OS
Supported operating system default values.
|
static interface |
InstallerManager.PACKAGE_FILE_NAME_FIELDS
Fields into the bundle file name message format.
|
static interface |
InstallerManager.STATE
Package state default values.
|
Modifier and Type | Field and Description |
---|---|
static int |
ACCESS_READ |
static int |
ACCESS_WRITE |
static java.lang.String |
PACKAGE_EXTENSION |
static java.lang.String |
PACKAGE_INDEX_EXTENSION |
static java.lang.String |
PACKAGE_INFO_FILE_NAME |
static java.lang.String |
PACKAGE_SET_EXTENSION |
Modifier and Type | Method and Description |
---|---|
void |
addLocalAddonRepository(java.io.File path)
Deprecated.
use addLocalAddonRepository(File path, String type)
|
void |
addLocalAddonRepository(java.io.File path,
java.lang.String type)
Adds an addon local repository location to the manager list,
and register the type of addons for this repository.
|
DependenciesCalculator |
createDependenciesCalculator(InstallPackageService installService)
Create a dependencies calculator.
|
Dependency |
createDependency()
Create a empty dependency object.
|
Dependency |
createDependency(PackageInfo packageInfo)
Create a dependency instance with the data of the package.
|
MakePackageService |
createMakePackage(java.io.File packageFolder,
PackageInfo packageInfo) |
PackageInfo |
createPackageInfo() |
PackageInfo |
createPackageInfo(java.io.InputStream packegeinfo)
Create a PackageInfo and load contents from the specified InputStream using the
default reader.
|
Version |
createVersion()
Create a version instance
|
java.io.File |
getAddonFolder(java.lang.String code)
Gets the folder of the addon with the code provided, or null if not
found.
|
java.util.List<java.io.File> |
getAddonFolders()
Gets a List of all the addon folders.
|
java.util.List<java.io.File> |
getAddonFolders(java.lang.String type)
Gets a List of all the addon folders of a type of package.
|
java.lang.String |
getArchitecture()
Returns the Architecture code of the system
|
java.lang.String |
getDefaultIndexSetFileExtension()
Returns the default extensions of the index set files.
|
java.io.File |
getDefaultLocalAddonRepository()
Deprecated.
|
java.io.File |
getDefaultLocalAddonRepository(java.lang.String packageType)
Get the path to the default local repository for a type of package.
|
java.io.File |
getDefaultLocalAddonRepository(java.lang.String packageType,
int access)
Get the path to the default local repository for a type of package.
|
java.lang.String |
getDefaultLocalRepositoryType(java.io.File file)
Retrieve the default type of addons for the file.
|
java.lang.String |
getDefaultPackageFileExtension()
Returns the default extensions of the package files.
|
PackageInfoReader |
getDefaultPackageInfoReader() |
PackageInfoWriter |
getDefaultPackageInfoWriter() |
java.lang.String |
getDefaultPackageSetFileExtension()
Returns the default extensions of the package set files.
|
java.net.URL |
getDownloadBaseURL() |
PackageInfo[] |
getInstalledPackages()
Returns a list of package infos for the already installed plugins.
|
PackageInfo[] |
getInstalledPackages(java.io.File pluginsDirectory)
Deprecated.
use getInstalledPackages() without parameters
|
InstallPackageService |
getInstallPackageService()
It creates and returns an object that is used to install a package in
gvSIG.
|
java.util.List<java.io.File> |
getLocalAddonRepositories()
Gets a List of all the folders where there might be addons folders
(addons repositories).
|
java.util.List<java.io.File> |
getLocalAddonRepositories(java.lang.String type)
Gets a List of all the folders where there might be addons folders
for the specified type of packages
(addons repositories).
|
MakePluginPackageService |
getMakePluginPackageService()
It creates and returns an object that is used to create a bundle that
contains inside a package of type plugin.
|
java.lang.String |
getOperatingSystem()
Return the OS code of the system
|
java.lang.String |
getOperatingSystemFamily() |
java.lang.String |
getOperatingSystemName() |
java.lang.String |
getOperatingSystemVersion() |
java.lang.String |
getPackageFileName(PackageInfo info)
Returns the name of the package file for a given package info.
|
java.lang.String |
getPackageIndexFileName(PackageInfo info)
Returns the name of the package index file for a given package info.
|
java.lang.String |
getPackageSetFileName(PackageInfo info)
Returns the name of the package set file for a given package info.
|
java.lang.String |
getPackageSetNameFormat()
Returns the package bundle file name format.
|
java.util.List<byte[]> |
getPublicKeys() |
java.lang.String |
getVersion()
Deprecated.
Use
getVersionEx() |
Version |
getVersionEx() |
boolean |
hasProviderToThisPackage(PackageInfo packageInfo) |
boolean |
needAdminRights() |
void |
registerInstallPackageService(java.lang.Class<? extends InstallPackageService> clazz)
It registers a class that implements the service for the installation of
a package that is inside a bundle.
|
void |
registerMakePluginPackageService(java.lang.Class<? extends MakePluginPackageService> clazz)
It registers a class that implements the service for the creation of
bundle that contains inside a package of type plugin.
|
void |
setDefaultLocalAddonRepository(java.io.File defaultAddonsRepository)
Deprecated.
|
void |
setDefaultLocalAddonRepository(java.io.File defaultAddonsRepository,
java.lang.String packageType)
Set the path to the default local repository for a type of package
|
void |
setDownloadBaseURL(java.net.URL url) |
void |
setPackageSetNameFormat(java.lang.String packageBundleNameFormat)
Sets the package bundle file name format.
|
void |
setVersion(java.lang.String version)
Deprecated.
|
void |
setVersion(Version version) |
createServiceParameters, getService
static final java.lang.String PACKAGE_INDEX_EXTENSION
static final java.lang.String PACKAGE_SET_EXTENSION
static final java.lang.String PACKAGE_EXTENSION
static final java.lang.String PACKAGE_INFO_FILE_NAME
static final int ACCESS_READ
static final int ACCESS_WRITE
void registerMakePluginPackageService(java.lang.Class<? extends MakePluginPackageService> clazz)
MakePluginPackageService
interface.clazz
- class that implements the MakePluginPackageService
interface.MakePluginPackageService getMakePluginPackageService() throws MakePluginPackageServiceException
MakePluginPackageService
interface. *MakePluginPackageServiceException
MakePluginPackageServiceException
- when there is a problem creating the servicePackageInfo[] getInstalledPackages(java.io.File pluginsDirectory) throws MakePluginPackageServiceException
pluginsDirectory
- where to look for the installed pluginsMakePluginPackageServiceException
- if there is an error loading the information of the installed
pluginsPackageInfo[] getInstalledPackages() throws MakePluginPackageServiceException
MakePluginPackageServiceException
- if there is an error loading the information of the installed
pluginsjava.lang.String getPackageSetNameFormat()
The string has to use a suitable MessageFormat
format, and the
available field numbers are the ones defined in the
BUNDLE_FILE_NAME_FIELDS interface.
void setPackageSetNameFormat(java.lang.String packageBundleNameFormat)
packageBundleNameFormat
- the package bundle file name format.getPackageSetNameFormat()
java.lang.String getPackageSetFileName(PackageInfo info)
info
- of the pluginjava.lang.String getPackageFileName(PackageInfo info)
info
- of the pluginjava.lang.String getPackageIndexFileName(PackageInfo info)
info
- of the pluginvoid registerInstallPackageService(java.lang.Class<? extends InstallPackageService> clazz)
InstallPackageService
interface.clazz
- class that implements the InstallPackageService
interface.InstallPackageService getInstallPackageService() throws InstallPackageServiceException
InstallPackageService
interface.InstallPackageServiceException
- when there is a problem creating the service.java.lang.String getDefaultPackageFileExtension()
java.lang.String getDefaultPackageSetFileExtension()
java.lang.String getDefaultIndexSetFileExtension()
java.lang.String getOperatingSystem()
java.lang.String getOperatingSystemFamily()
java.lang.String getOperatingSystemName()
java.lang.String getOperatingSystemVersion()
java.lang.String getArchitecture()
Dependency createDependency()
Dependency createDependency(PackageInfo packageInfo)
packageInfo
- DependenciesCalculator createDependenciesCalculator(InstallPackageService installService)
Version createVersion()
PackageInfo createPackageInfo()
PackageInfo createPackageInfo(java.io.InputStream packegeinfo) throws BaseException
packegeinfo
- as URLjava.io.IOException
BaseException
PackageInfoWriter getDefaultPackageInfoWriter()
PackageInfoReader getDefaultPackageInfoReader()
MakePackageService createMakePackage(java.io.File packageFolder, PackageInfo packageInfo)
void setDownloadBaseURL(java.net.URL url)
java.net.URL getDownloadBaseURL()
void setVersion(Version version)
Version getVersionEx()
void setVersion(java.lang.String version)
setVersion(Version)
version
- java.lang.String getVersion()
getVersionEx()
java.util.List<java.io.File> getLocalAddonRepositories()
java.util.List<java.io.File> getLocalAddonRepositories(java.lang.String type)
void addLocalAddonRepository(java.io.File path, java.lang.String type)
path
- of the repositorytype
- of addons in this repositoryvoid addLocalAddonRepository(java.io.File path)
java.lang.String getDefaultLocalRepositoryType(java.io.File file)
file
- java.util.List<java.io.File> getAddonFolders()
java.util.List<java.io.File> getAddonFolders(java.lang.String type)
java.io.File getAddonFolder(java.lang.String code)
code
- of the addonvoid setDefaultLocalAddonRepository(java.io.File defaultAddonsRepository)
setDefaultLocalAddonRepository(java.io.File, java.lang.String)
defaultAddonsRepository
- java.io.File getDefaultLocalAddonRepository()
getDefaultLocalAddonRepository(java.lang.String)
java.io.File getDefaultLocalAddonRepository(java.lang.String packageType, int access)
packageType
- type of package for that ask the default pathaccess
- type of access to the repository.java.io.File getDefaultLocalAddonRepository(java.lang.String packageType)
packageType
- type of package for that ask the default pathvoid setDefaultLocalAddonRepository(java.io.File defaultAddonsRepository, java.lang.String packageType)
defaultAddonsRepository
- path to the repositorypackageType
- type of package in this repository pathjava.util.List<byte[]> getPublicKeys()
boolean hasProviderToThisPackage(PackageInfo packageInfo)
boolean needAdminRights()