Interface InstallPackageService
- All Superinterfaces:
org.gvsig.tools.service.Service
public interface InstallPackageService
extends org.gvsig.tools.service.Service
This service is used to read a bundle file and install the packages contained in it. It has methods to read the packages contained in a bundle and to install one of them.
The bundle is a file that has been created using the
MakePluginPackageService service. It is possible to create an
installer manually, but it has to have the structure defined by the
InstallerManager class.
- Author:
- Jorge Piera Llodrá
-
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a the URI of a bundle that contains some packages to install.voidAdds a URL of a bundle that contains some packages to install.voidaddBundlesFromDirectory(File bundlesDirectory, org.gvsig.tools.task.SimpleTaskStatus taskStatus) In reads a directory and reads all the bundles.voiddownloadPackage(org.gvsig.installer.lib.api.PackageInfo packageInfo, org.gvsig.tools.task.SimpleTaskStatus taskStatus) Download the package and register it in the manager.Gets the list of all the categories of *all* the packages.intorg.gvsig.installer.lib.api.PackageInfogetPackageInfo(int index) Return the package information for a concrete position.org.gvsig.installer.lib.api.PackageInfogetPackageInfo(String packageCode) Return the package information for a concrete position.Get the proprties associates to this bundle.getTypes()Gets the list of different the types of *all* the packages.voidinstallPackage(File applicationDirectory, String packageCode) Install a package in a concrete gvSIG installation directory.voidinstallPackage(File applicationDirectory, org.gvsig.installer.lib.api.PackageInfo packageInfo) Install a package in a concrete gvSIG installation directory.voidinstallPackageProviders(org.gvsig.tools.task.SimpleTaskStatus taskStatus) booleanvoidreset()Methods inherited from interface org.gvsig.tools.service.Service
getManager
-
Method Details
-
reset
void reset() -
addBundle
void addBundle(File bundleFile, org.gvsig.tools.task.SimpleTaskStatus taskStatus) throws InstallPackageServiceException Adds a the URI of a bundle that contains some packages to install. A bundle is a compressed zip file with a structure defined in theInstallerManagerclass.- Parameters:
bundleFile-taskStatus-- Throws:
InstallPackageServiceException- it is thrown if there is an exception reading the URI.
-
addBundle
void addBundle(URL bundleURL, org.gvsig.tools.task.SimpleTaskStatus taskStatus) throws InstallPackageServiceException Adds a URL of a bundle that contains some packages to install. A bundle is a compressed zip file with a structure defined in theInstallerManagerclass.- Parameters:
bundleURL- theURLof a bundle.taskStatus-- Throws:
InstallPackageServiceException- it is thrown if there is an exception reading theURL.
-
addBundlesFromDirectory
void addBundlesFromDirectory(File bundlesDirectory, org.gvsig.tools.task.SimpleTaskStatus taskStatus) throws InstallPackageServiceException In reads a directory and reads all the bundles. This method retrieve all the information of the packages located in the bundles and allows to the user to show this information.- Parameters:
bundlesDirectory- a directory that contains bundles.taskStatus-- Throws:
InstallPackageServiceException- If there is any problem reading the directory of bundles.
-
installPackage
void installPackage(File applicationDirectory, org.gvsig.installer.lib.api.PackageInfo packageInfo) throws InstallPackageServiceException Install a package in a concrete gvSIG installation directory. The selected package has to be contained in one of the bundles that has been previously added using theor theinvalid reference
#addBundle(File)method.invalid reference
#addBundlesFromDirectory(File)- Parameters:
applicationDirectory- a valid root directory where an instance og gvSIG is installed.packageInfo- the package to install.- Throws:
InstallPackageServiceException- If there is an error installing the package.
-
installPackage
void installPackage(File applicationDirectory, String packageCode) throws InstallPackageServiceException Install a package in a concrete gvSIG installation directory. The selected package has to be contained in one of the bundles that has been previously added using theor theinvalid reference
#addBundle(File)method.invalid reference
#addBundlesFromDirectory(File)- Parameters:
applicationDirectory- a valid root directory where an instance og gvSIG is installed.packageCode- the code of the package.- Throws:
InstallPackageServiceException- if there is an error installing the}invalid @link
{@link PackageInfo#
-
getPackageCount
int getPackageCount()- Returns:
- the number of packages that has been loaded form one or more
bundles using the
or the
invalid reference
#addBundle(File)method.invalid reference
#addBundlesFromDirectory(File)
-
getPackageInfo
org.gvsig.installer.lib.api.PackageInfo getPackageInfo(int index) Return the package information for a concrete position. All the packages has been loaded form one or more bundles using theor theinvalid reference
#addBundle(File)method.invalid reference
#addBundlesFromDirectory(File)- Parameters:
index- the position of the package.- Returns:
- the information of a package. returns
nullif the package doesn't exist.
-
getPackageInfo
Return the package information for a concrete position. All the packages has been loaded form one or more bundles using theor theinvalid reference
#addBundle(File)method.invalid reference
#addBundlesFromDirectory(File)- Parameters:
packageCode- the code of the package.- Returns:
- the information of a package. returns
nullif the package doesn't exist.
-
downloadPackage
void downloadPackage(org.gvsig.installer.lib.api.PackageInfo packageInfo, org.gvsig.tools.task.SimpleTaskStatus taskStatus) throws InstallPackageServiceException Download the package and register it in the manager.- Parameters:
packageInfo-- Throws:
InstallPackageServiceException
-
getDefaultSelectedPackagesIDs
- Returns:
-
getProperties
Properties getProperties()Get the proprties associates to this bundle. Return an empty Propertis if the bundle dont have a properties.- Returns:
-
getCategories
Gets the list of all the categories of *all* the packages.- Returns:
- a list with the categories of all the packages.
-
getTypes
Gets the list of different the types of *all* the packages.- Returns:
- a list with the types of packages.
-
needInstallPackageProviders
boolean needInstallPackageProviders() -
installPackageProviders
void installPackageProviders(org.gvsig.tools.task.SimpleTaskStatus taskStatus)
-