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 String |
PACKAGE_EXTENSION |
static String |
PACKAGE_INDEX_EXTENSION |
static String |
PACKAGE_INFO_FILE_NAME |
static String |
PACKAGE_SET_EXTENSION |
Modifier and Type | Method and Description |
---|---|
void |
addLocalAddonRepository(File path)
Deprecated.
use addLocalAddonRepository(File path, String type)
|
void |
addLocalAddonRepository(File path,
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(File packageFolder,
PackageInfo packageInfo) |
PackageInfo |
createPackageInfo() |
PackageInfo |
createPackageInfo(InputStream packegeinfo)
Create a PackageInfo and load contents from the specified InputStream using the
default reader.
|
Version |
createVersion()
Create a version instance
|
File |
getAddonFolder(String code)
Gets the folder of the addon with the code provided, or null if not
found.
|
List<File> |
getAddonFolders()
Gets a List of all the addon folders.
|
List<File> |
getAddonFolders(String type)
Gets a List of all the addon folders of a type of package.
|
String |
getArchitecture()
Returns the Architecture code of the system
|
String |
getDefaultIndexSetFileExtension()
Returns the default extensions of the index set files.
|
File |
getDefaultLocalAddonRepository()
Deprecated.
|
File |
getDefaultLocalAddonRepository(String packageType)
Get the path to the default local repository for a type of package.
|
File |
getDefaultLocalAddonRepository(String packageType,
int access)
Get the path to the default local repository for a type of package.
|
String |
getDefaultLocalRepositoryType(File file)
Retrieve the default type of addons for the file.
|
String |
getDefaultPackageFileExtension()
Returns the default extensions of the package files.
|
PackageInfoReader |
getDefaultPackageInfoReader() |
PackageInfoWriter |
getDefaultPackageInfoWriter() |
String |
getDefaultPackageSetFileExtension()
Returns the default extensions of the package set files.
|
URL |
getDownloadBaseURL() |
PackageInfo[] |
getInstalledPackages()
Returns a list of package infos for the already installed plugins.
|
PackageInfo[] |
getInstalledPackages(File pluginsDirectory)
Deprecated.
use getInstalledPackages() without parameters
|
InstallPackageService |
getInstallPackageService()
It creates and returns an object that is used to install a package in
gvSIG.
|
List<File> |
getLocalAddonRepositories()
Gets a List of all the folders where there might be addons folders
(addons repositories).
|
List<File> |
getLocalAddonRepositories(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.
|
String |
getOperatingSystem()
Return the OS code of the system
|
String |
getOperatingSystemFamily() |
String |
getOperatingSystemName() |
String |
getOperatingSystemVersion() |
String |
getPackageFileName(PackageInfo info)
Returns the name of the package file for a given package info.
|
String |
getPackageIndexFileName(PackageInfo info)
Returns the name of the package index file for a given package info.
|
String |
getPackageSetFileName(PackageInfo info)
Returns the name of the package set file for a given package info.
|
String |
getPackageSetNameFormat()
Returns the package bundle file name format.
|
List<byte[]> |
getPublicKeys() |
String |
getVersion()
Deprecated.
Use
getVersionEx() |
Version |
getVersionEx() |
boolean |
hasProviderToThisPackage(PackageInfo packageInfo) |
boolean |
needAdminRights() |
void |
registerInstallPackageService(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(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(File defaultAddonsRepository)
Deprecated.
|
void |
setDefaultLocalAddonRepository(File defaultAddonsRepository,
String packageType)
Set the path to the default local repository for a type of package
|
void |
setDownloadBaseURL(URL url) |
void |
setPackageSetNameFormat(String packageBundleNameFormat)
Sets the package bundle file name format.
|
void |
setVersion(String version)
Deprecated.
|
void |
setVersion(Version version) |
createServiceParameters, getService
static final String PACKAGE_INDEX_EXTENSION
static final String PACKAGE_SET_EXTENSION
static final String PACKAGE_EXTENSION
static final String PACKAGE_INFO_FILE_NAME
static final int ACCESS_READ
static final int ACCESS_WRITE
void registerMakePluginPackageService(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(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
pluginsString 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(String packageBundleNameFormat)
packageBundleNameFormat
- the package bundle file name format.getPackageSetNameFormat()
String getPackageSetFileName(PackageInfo info)
info
- of the pluginString getPackageFileName(PackageInfo info)
info
- of the pluginString getPackageIndexFileName(PackageInfo info)
info
- of the pluginvoid registerInstallPackageService(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.String getDefaultPackageFileExtension()
String getDefaultPackageSetFileExtension()
String getDefaultIndexSetFileExtension()
String getOperatingSystem()
String getOperatingSystemFamily()
String getOperatingSystemName()
String getOperatingSystemVersion()
String getArchitecture()
Dependency createDependency()
Dependency createDependency(PackageInfo packageInfo)
packageInfo
- DependenciesCalculator createDependenciesCalculator(InstallPackageService installService)
Version createVersion()
PackageInfo createPackageInfo()
PackageInfo createPackageInfo(InputStream packegeinfo) throws BaseException
packegeinfo
- as URLIOException
BaseException
PackageInfoWriter getDefaultPackageInfoWriter()
PackageInfoReader getDefaultPackageInfoReader()
MakePackageService createMakePackage(File packageFolder, PackageInfo packageInfo)
void setDownloadBaseURL(URL url)
URL getDownloadBaseURL()
void setVersion(Version version)
Version getVersionEx()
void setVersion(String version)
setVersion(Version)
version
- String getVersion()
getVersionEx()
List<File> getLocalAddonRepositories()
List<File> getLocalAddonRepositories(String type)
void addLocalAddonRepository(File path, String type)
path
- of the repositorytype
- of addons in this repositoryvoid addLocalAddonRepository(File path)
String getDefaultLocalRepositoryType(File file)
file
- List<File> getAddonFolders()
List<File> getAddonFolders(String type)
File getAddonFolder(String code)
code
- of the addonvoid setDefaultLocalAddonRepository(File defaultAddonsRepository)
setDefaultLocalAddonRepository(java.io.File, java.lang.String)
defaultAddonsRepository
- File getDefaultLocalAddonRepository()
getDefaultLocalAddonRepository(java.lang.String)
File getDefaultLocalAddonRepository(String packageType, int access)
packageType
- type of package for that ask the default pathaccess
- type of access to the repository.File getDefaultLocalAddonRepository(String packageType)
packageType
- type of package for that ask the default pathvoid setDefaultLocalAddonRepository(File defaultAddonsRepository, String packageType)
defaultAddonsRepository
- path to the repositorypackageType
- type of package in this repository pathList<byte[]> getPublicKeys()
boolean hasProviderToThisPackage(PackageInfo packageInfo)
boolean needAdminRights()