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 Type
    Method
    Description
    void
    addBundle(File bundleFile, org.gvsig.tools.task.SimpleTaskStatus taskStatus)
    Adds a the URI of a bundle that contains some packages to install.
    void
    addBundle(URL bundleURL, org.gvsig.tools.task.SimpleTaskStatus taskStatus)
    Adds a URL of a bundle that contains some packages to install.
    void
    addBundlesFromDirectory(File bundlesDirectory, org.gvsig.tools.task.SimpleTaskStatus taskStatus)
    In reads a directory and reads all the bundles.
    void
    downloadPackage(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.
     
    int
     
    org.gvsig.installer.lib.api.PackageInfo
    getPackageInfo(int index)
    Return the package information for a concrete position.
    org.gvsig.installer.lib.api.PackageInfo
    getPackageInfo(String packageCode)
    Return the package information for a concrete position.
    Get the proprties associates to this bundle.
    Gets the list of different the types of *all* the packages.
    void
    installPackage(File applicationDirectory, String packageCode)
    Install a package in a concrete gvSIG installation directory.
    void
    installPackage(File applicationDirectory, org.gvsig.installer.lib.api.PackageInfo packageInfo)
    Install a package in a concrete gvSIG installation directory.
    void
    installPackageProviders(org.gvsig.tools.task.SimpleTaskStatus taskStatus)
     
    boolean
     
    void
     

    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 the InstallerManager class.
      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 the InstallerManager class.
      Parameters:
      bundleURL - the URL of a bundle.
      taskStatus -
      Throws:
      InstallPackageServiceException - it is thrown if there is an exception reading the URL .
    • 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 the
      invalid reference
      #addBundle(File)
      or the
      invalid reference
      #addBundlesFromDirectory(File)
      method.
      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 the
      invalid reference
      #addBundle(File)
      or the
      invalid reference
      #addBundlesFromDirectory(File)
      method.
      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
      invalid reference
      #addBundle(File)
      or the
      invalid reference
      #addBundlesFromDirectory(File)
      method.
    • 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 the
      invalid reference
      #addBundle(File)
      or the
      invalid reference
      #addBundlesFromDirectory(File)
      method.
      Parameters:
      index - the position of the package.
      Returns:
      the information of a package. returns null if the package doesn't exist.
    • getPackageInfo

      org.gvsig.installer.lib.api.PackageInfo getPackageInfo(String packageCode)
      Return the package information for a concrete position. All the packages has been loaded form one or more bundles using the
      invalid reference
      #addBundle(File)
      or the
      invalid reference
      #addBundlesFromDirectory(File)
      method.
      Parameters:
      packageCode - the code of the package.
      Returns:
      the information of a package. returns null if 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

      List<String> 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

      List<String> getCategories()
      Gets the list of all the categories of *all* the packages.
      Returns:
      a list with the categories of all the packages.
    • getTypes

      List<String> 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)