public class DefaultInstallerManager extends AbstractManager implements InstallerManager
Modifier and Type | Class and Description |
---|---|
class |
DefaultInstallerManager.InstallerCreationException |
InstallerManager.ARCH, InstallerManager.JVM, InstallerManager.OS, InstallerManager.PACKAGE_FILE_NAME_FIELDS, InstallerManager.STATE
ACCESS_READ, ACCESS_WRITE, PACKAGE_EXTENSION, PACKAGE_INDEX_EXTENSION, PACKAGE_INFO_FILE_NAME, PACKAGE_SET_EXTENSION
Constructor and Description |
---|
DefaultInstallerManager() |
Modifier and Type | Method and Description |
---|---|
void |
addLocalAddonRepository(java.io.File path) |
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.File file) |
PackageInfo |
createPackageInfo(java.io.InputStream stream)
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()
The local addons folder where normally all addons are installed.
|
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)
Returns a list of package infos for the already installed plugins.
|
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 |
getPackageIndexNameFormat() |
java.lang.String |
getPackageNameFormat() |
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() |
Service |
getService(DynObject parameters)
Creates a new
Service based on the given parameters. |
java.lang.String |
getVersion() |
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)
The local addons folder where normally all addons are installed.
|
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 |
setPackageIndexNameFormat(java.lang.String packageIndexNameFormat) |
void |
setPackageNameFormat(java.lang.String packageNameFormat) |
void |
setPackageSetNameFormat(java.lang.String packageSetNameFormat)
Sets the package bundle file name format.
|
void |
setVersion(java.lang.String version) |
void |
setVersion(Version version) |
createServiceParameters, getProviderManager
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
createServiceParameters
public java.lang.String getPackageSetNameFormat()
InstallerManager
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.
getPackageSetNameFormat
in interface InstallerManager
public void setPackageSetNameFormat(java.lang.String packageSetNameFormat)
InstallerManager
setPackageSetNameFormat
in interface InstallerManager
packageSetNameFormat
- the package bundle file name format.InstallerManager.getPackageSetNameFormat()
public java.lang.String getPackageNameFormat()
public void setPackageNameFormat(java.lang.String packageNameFormat)
public java.lang.String getPackageIndexNameFormat()
public void setPackageIndexNameFormat(java.lang.String packageIndexNameFormat)
public MakePluginPackageService getMakePluginPackageService() throws MakePluginPackageServiceException
InstallerManager
MakePluginPackageService
interface. *getMakePluginPackageService
in interface InstallerManager
MakePluginPackageServiceException
public InstallPackageService getInstallPackageService() throws InstallPackageServiceException
InstallerManager
InstallPackageService
interface.getInstallPackageService
in interface InstallerManager
InstallPackageServiceException
- when there is a problem creating the service.public void registerMakePluginPackageService(java.lang.Class<? extends MakePluginPackageService> clazz)
InstallerManager
MakePluginPackageService
interface.registerMakePluginPackageService
in interface InstallerManager
clazz
- class that implements the MakePluginPackageService
interface.public void registerInstallPackageService(java.lang.Class<? extends InstallPackageService> clazz)
InstallerManager
InstallPackageService
interface.registerInstallPackageService
in interface InstallerManager
clazz
- class that implements the InstallPackageService
interface.public Service getService(DynObject parameters) throws ServiceException
Manager
Service
based on the given parameters.getService
in interface Manager
parameters
- of the Service
to createService
ServiceException
- if there is an error creating the Service, or the parameters
are not validpublic java.lang.String getPackageSetFileName(PackageInfo info)
InstallerManager
getPackageSetFileName
in interface InstallerManager
info
- of the pluginpublic java.lang.String getPackageFileName(PackageInfo info)
InstallerManager
getPackageFileName
in interface InstallerManager
info
- of the pluginpublic java.lang.String getPackageIndexFileName(PackageInfo info)
InstallerManager
getPackageIndexFileName
in interface InstallerManager
info
- of the pluginpublic PackageInfo[] getInstalledPackages(java.io.File pluginsDirectory) throws MakePluginPackageServiceException
InstallerManager
getInstalledPackages
in interface InstallerManager
pluginsDirectory
- where to look for the installed pluginsMakePluginPackageServiceException
- if there is an error loading the information of the installed
pluginspublic PackageInfo[] getInstalledPackages() throws MakePluginPackageServiceException
InstallerManager
getInstalledPackages
in interface InstallerManager
MakePluginPackageServiceException
- if there is an error loading the information of the installed
pluginspublic java.lang.String getDefaultPackageFileExtension()
InstallerManager
getDefaultPackageFileExtension
in interface InstallerManager
public java.lang.String getDefaultPackageSetFileExtension()
InstallerManager
getDefaultPackageSetFileExtension
in interface InstallerManager
public java.lang.String getDefaultIndexSetFileExtension()
InstallerManager
getDefaultIndexSetFileExtension
in interface InstallerManager
public java.lang.String getOperatingSystem()
InstallerManager
getOperatingSystem
in interface InstallerManager
public java.lang.String getOperatingSystemFamily()
getOperatingSystemFamily
in interface InstallerManager
public java.lang.String getOperatingSystemName()
getOperatingSystemName
in interface InstallerManager
public java.lang.String getOperatingSystemVersion()
getOperatingSystemVersion
in interface InstallerManager
public java.lang.String getArchitecture()
InstallerManager
getArchitecture
in interface InstallerManager
public Dependency createDependency(PackageInfo packageInfo)
InstallerManager
createDependency
in interface InstallerManager
public Dependency createDependency()
InstallerManager
createDependency
in interface InstallerManager
public DependenciesCalculator createDependenciesCalculator(InstallPackageService installService)
InstallerManager
createDependenciesCalculator
in interface InstallerManager
public Version createVersion()
InstallerManager
createVersion
in interface InstallerManager
public PackageInfoReader getDefaultPackageInfoReader()
getDefaultPackageInfoReader
in interface InstallerManager
public PackageInfoWriter getDefaultPackageInfoWriter()
getDefaultPackageInfoWriter
in interface InstallerManager
public MakePackageService createMakePackage(java.io.File packageFolder, PackageInfo packageInfo)
createMakePackage
in interface InstallerManager
public PackageInfo createPackageInfo()
createPackageInfo
in interface InstallerManager
public PackageInfo createPackageInfo(java.io.InputStream stream) throws BaseException
InstallerManager
createPackageInfo
in interface InstallerManager
stream
- as URLBaseException
public PackageInfo createPackageInfo(java.io.File file) throws BaseException
BaseException
public java.net.URL getDownloadBaseURL()
getDownloadBaseURL
in interface InstallerManager
public java.lang.String getVersion()
getVersion
in interface InstallerManager
public void setVersion(Version version)
setVersion
in interface InstallerManager
public Version getVersionEx()
getVersionEx
in interface InstallerManager
public void setDownloadBaseURL(java.net.URL url)
setDownloadBaseURL
in interface InstallerManager
public void setVersion(java.lang.String version)
setVersion
in interface InstallerManager
public java.io.File getDefaultLocalAddonRepository()
InstallerManager
getDefaultLocalAddonRepository
in interface InstallerManager
public void setDefaultLocalAddonRepository(java.io.File defaultAddonsRepository)
InstallerManager
setDefaultLocalAddonRepository
in interface InstallerManager
public void addLocalAddonRepository(java.io.File path)
addLocalAddonRepository
in interface InstallerManager
public java.io.File getDefaultLocalAddonRepository(java.lang.String packageType)
InstallerManager
getDefaultLocalAddonRepository
in interface InstallerManager
packageType
- type of package for that ask the default pathpublic boolean needAdminRights()
needAdminRights
in interface InstallerManager
public java.io.File getDefaultLocalAddonRepository(java.lang.String packageType, int access)
InstallerManager
getDefaultLocalAddonRepository
in interface InstallerManager
packageType
- type of package for that ask the default pathaccess
- type of access to the repository.public void setDefaultLocalAddonRepository(java.io.File defaultAddonsRepository, java.lang.String packageType)
InstallerManager
setDefaultLocalAddonRepository
in interface InstallerManager
defaultAddonsRepository
- path to the repositorypackageType
- type of package in this repository pathpublic void addLocalAddonRepository(java.io.File path, java.lang.String type)
InstallerManager
addLocalAddonRepository
in interface InstallerManager
path
- of the repositorytype
- of addons in this repositorypublic java.lang.String getDefaultLocalRepositoryType(java.io.File file)
InstallerManager
getDefaultLocalRepositoryType
in interface InstallerManager
public java.util.List<java.io.File> getLocalAddonRepositories()
InstallerManager
getLocalAddonRepositories
in interface InstallerManager
public java.util.List<java.io.File> getLocalAddonRepositories(java.lang.String type)
InstallerManager
getLocalAddonRepositories
in interface InstallerManager
public java.util.List<java.io.File> getAddonFolders()
InstallerManager
getAddonFolders
in interface InstallerManager
public java.util.List<java.io.File> getAddonFolders(java.lang.String type)
InstallerManager
getAddonFolders
in interface InstallerManager
public java.io.File getAddonFolder(java.lang.String code)
InstallerManager
getAddonFolder
in interface InstallerManager
code
- of the addonpublic java.util.List<byte[]> getPublicKeys()
getPublicKeys
in interface InstallerManager
public boolean hasProviderToThisPackage(PackageInfo packageInfo)
hasProviderToThisPackage
in interface InstallerManager