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(File path) |
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(File file) |
PackageInfo |
createPackageInfo(InputStream stream)
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()
The local addons folder where normally all addons are installed.
|
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)
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.
|
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 |
getPackageIndexNameFormat() |
String |
getPackageNameFormat() |
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() |
Service |
getService(DynObject parameters)
Creates a new
Service based on the given parameters. |
String |
getVersion() |
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)
The local addons folder where normally all addons are installed.
|
void |
setDefaultLocalAddonRepository(File defaultAddonsRepository,
String packageType)
Set the path to the default local repository for a type of package
|
void |
setDownloadBaseURL(URL url) |
void |
setPackageIndexNameFormat(String packageIndexNameFormat) |
void |
setPackageNameFormat(String packageNameFormat) |
void |
setPackageSetNameFormat(String packageSetNameFormat)
Sets the package bundle file name format.
|
void |
setVersion(String version) |
void |
setVersion(Version version) |
createServiceParameters, getProviderManager
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
createServiceParameters
public 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(String packageSetNameFormat)
InstallerManager
setPackageSetNameFormat
in interface InstallerManager
packageSetNameFormat
- the package bundle file name format.InstallerManager.getPackageSetNameFormat()
public String getPackageNameFormat()
public void setPackageNameFormat(String packageNameFormat)
public String getPackageIndexNameFormat()
public void setPackageIndexNameFormat(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(Class<? extends MakePluginPackageService> clazz)
InstallerManager
MakePluginPackageService
interface.registerMakePluginPackageService
in interface InstallerManager
clazz
- class that implements the MakePluginPackageService
interface.public void registerInstallPackageService(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 String getPackageSetFileName(PackageInfo info)
InstallerManager
getPackageSetFileName
in interface InstallerManager
info
- of the pluginpublic String getPackageFileName(PackageInfo info)
InstallerManager
getPackageFileName
in interface InstallerManager
info
- of the pluginpublic String getPackageIndexFileName(PackageInfo info)
InstallerManager
getPackageIndexFileName
in interface InstallerManager
info
- of the pluginpublic PackageInfo[] getInstalledPackages(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 String getDefaultPackageFileExtension()
InstallerManager
getDefaultPackageFileExtension
in interface InstallerManager
public String getDefaultPackageSetFileExtension()
InstallerManager
getDefaultPackageSetFileExtension
in interface InstallerManager
public String getDefaultIndexSetFileExtension()
InstallerManager
getDefaultIndexSetFileExtension
in interface InstallerManager
public String getOperatingSystem()
InstallerManager
getOperatingSystem
in interface InstallerManager
public String getOperatingSystemFamily()
getOperatingSystemFamily
in interface InstallerManager
public String getOperatingSystemName()
getOperatingSystemName
in interface InstallerManager
public String getOperatingSystemVersion()
getOperatingSystemVersion
in interface InstallerManager
public 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(File packageFolder, PackageInfo packageInfo)
createMakePackage
in interface InstallerManager
public PackageInfo createPackageInfo()
createPackageInfo
in interface InstallerManager
public PackageInfo createPackageInfo(InputStream stream) throws BaseException
InstallerManager
createPackageInfo
in interface InstallerManager
stream
- as URLBaseException
public PackageInfo createPackageInfo(File file) throws BaseException
BaseException
public URL getDownloadBaseURL()
getDownloadBaseURL
in interface InstallerManager
public 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(URL url)
setDownloadBaseURL
in interface InstallerManager
public void setVersion(String version)
setVersion
in interface InstallerManager
public File getDefaultLocalAddonRepository()
InstallerManager
getDefaultLocalAddonRepository
in interface InstallerManager
public void setDefaultLocalAddonRepository(File defaultAddonsRepository)
InstallerManager
setDefaultLocalAddonRepository
in interface InstallerManager
public void addLocalAddonRepository(File path)
addLocalAddonRepository
in interface InstallerManager
public File getDefaultLocalAddonRepository(String packageType)
InstallerManager
getDefaultLocalAddonRepository
in interface InstallerManager
packageType
- type of package for that ask the default pathpublic boolean needAdminRights()
needAdminRights
in interface InstallerManager
public File getDefaultLocalAddonRepository(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(File defaultAddonsRepository, String packageType)
InstallerManager
setDefaultLocalAddonRepository
in interface InstallerManager
defaultAddonsRepository
- path to the repositorypackageType
- type of package in this repository pathpublic void addLocalAddonRepository(File path, String type)
InstallerManager
addLocalAddonRepository
in interface InstallerManager
path
- of the repositorytype
- of addons in this repositorypublic String getDefaultLocalRepositoryType(File file)
InstallerManager
getDefaultLocalRepositoryType
in interface InstallerManager
public List<File> getLocalAddonRepositories()
InstallerManager
getLocalAddonRepositories
in interface InstallerManager
public List<File> getLocalAddonRepositories(String type)
InstallerManager
getLocalAddonRepositories
in interface InstallerManager
public List<File> getAddonFolders()
InstallerManager
getAddonFolders
in interface InstallerManager
public List<File> getAddonFolders(String type)
InstallerManager
getAddonFolders
in interface InstallerManager
public File getAddonFolder(String code)
InstallerManager
getAddonFolder
in interface InstallerManager
code
- of the addonpublic List<byte[]> getPublicKeys()
getPublicKeys
in interface InstallerManager
public boolean hasProviderToThisPackage(PackageInfo packageInfo)
hasProviderToThisPackage
in interface InstallerManager