Interface InstallPackageProviderServices

All Superinterfaces:
org.gvsig.tools.service.spi.ProviderServices

public interface InstallPackageProviderServices extends org.gvsig.tools.service.spi.ProviderServices
Services that can be used by the providers to create or exceute the bundle. It contains methods to compress and to decompress files and methods to read an install a package file from a directory.
Author:
Jorge Piera Llodrá
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Compress a plugin folder using the plugin's name as a package.
    void
    Compress a plugin folder using the plugin's name as a package, only with the files needed by the package index.
    void
    compressPackageSet(File folder, String fileName, OutputStream os)
    Compress a folder as a zipped package set in the given outputstream with a concrete name.
    void
    decompress(InputStream is, File outputDirectory)
    It decompress an input stream and write it on a directory.
     
     
    org.gvsig.installer.lib.api.PackageInfo
    It reads a compressed file and retrieve the package information.
    void
    readPackageInfo(File directory, org.gvsig.installer.lib.api.PackageInfo installerInfo)
    Reads the package.info file from a directory a fills the the properties of the PackageInfo object.
    void
    readPackageInfo(InputStream is, List<org.gvsig.installer.lib.api.PackageInfo> packageInfos, Map<org.gvsig.installer.lib.api.PackageInfo,String> zipEntriesMap, String name, org.gvsig.tools.task.SimpleTaskStatus taskStatus)
    Reads the package.info file from a bundle fills the the properties of the PackageInfo objects.
    void
    readPackageSetInfo(InputStream is, List<org.gvsig.installer.lib.api.PackageInfo> packageInfos, Map<org.gvsig.installer.lib.api.PackageInfo,String> zipEntriesMap, org.gvsig.tools.task.SimpleTaskStatus taskStatus)
    Reads the package.info file from a package set and fills the the properties of the PackageInfo objects.
    It search a package inside an installer file by the zip name and returns the stream in this position ready to decompres.
    void
    writePackageInfo(File directory, org.gvsig.installer.lib.api.PackageInfo packageInfo)
    Writes the package.info file in a concrete directory.
    void
    writePackageInfoForIndex(File directory, org.gvsig.installer.lib.api.PackageInfo packageInfo)
    Writes the package.info file in a concrete directory to be used in a package index.

    Methods inherited from interface org.gvsig.tools.service.spi.ProviderServices

    getParameters, getService
  • Method Details

    • decompress

      void decompress(InputStream is, File outputDirectory) throws org.gvsig.installer.lib.api.execution.InstallPackageServiceException
      It decompress an input stream and write it on a directory.
      Parameters:
      is - The input stream to decompress
      outputDirectory - . The output directory.
      Throws:
      org.gvsig.installer.lib.api.execution.InstallPackageServiceException - If there is a problem decompressing the stream.
    • compressPackageSet

      void compressPackageSet(File folder, String fileName, OutputStream os) throws org.gvsig.installer.lib.api.creation.MakePluginPackageServiceException
      Compress a folder as a zipped package set in the given outputstream with a concrete name.
      Parameters:
      folder - the folder to compress.
      fileName - name of the zip entry that has the output file. The name that have to have
      os - output stream to write the output.
      Throws:
      org.gvsig.installer.lib.api.creation.MakePluginPackageServiceException - if there is any problem compressing.
    • compressPackage

      void compressPackage(File folder, OutputStream os) throws org.gvsig.installer.lib.api.creation.MakePluginPackageServiceException
      Compress a plugin folder using the plugin's name as a package.
      Parameters:
      folder - the directory to compress.
      os - output stream to write the output.
      Throws:
      org.gvsig.installer.lib.api.creation.MakePluginPackageServiceException - if there is any problem compressing.
    • compressPackageIndex

      void compressPackageIndex(File folder, OutputStream os) throws org.gvsig.installer.lib.api.creation.MakePluginPackageServiceException
      Compress a plugin folder using the plugin's name as a package, only with the files needed by the package index.
      Parameters:
      folder - the directory to compress.
      os - output stream to write the output.
      Throws:
      org.gvsig.installer.lib.api.creation.MakePluginPackageServiceException - if there is any problem compressing.
    • readPackageInfo

      void readPackageInfo(File directory, org.gvsig.installer.lib.api.PackageInfo installerInfo) throws InstallerInfoFileException
      Reads the package.info file from a directory a fills the the properties of the PackageInfo object.
      Parameters:
      directory - the root directory that contains the installinfo file
      installInfo - the installinfo file that has to be filled.
      Throws:
      InstallerInfoFileException
    • readPackageSetInfo

      void readPackageSetInfo(InputStream is, List<org.gvsig.installer.lib.api.PackageInfo> packageInfos, Map<org.gvsig.installer.lib.api.PackageInfo,String> zipEntriesMap, org.gvsig.tools.task.SimpleTaskStatus taskStatus) throws org.gvsig.installer.lib.api.execution.InstallPackageServiceException
      Reads the package.info file from a package set and fills the the properties of the PackageInfo objects.
      Parameters:
      is - the input stream of a bundle.
      packageInfos - a list of the information of the packages to install.
      zipEntriesMap - a map to retrieve the zipEntry for every package. This information is necessary to select the plugin to decompress.
      Throws:
      org.gvsig.installer.lib.api.execution.InstallPackageServiceException - if there is a problem reading the bundle.
    • readPackageInfo

      void readPackageInfo(InputStream is, List<org.gvsig.installer.lib.api.PackageInfo> packageInfos, Map<org.gvsig.installer.lib.api.PackageInfo,String> zipEntriesMap, String name, org.gvsig.tools.task.SimpleTaskStatus taskStatus) throws org.gvsig.installer.lib.api.execution.InstallPackageServiceException
      Reads the package.info file from a bundle fills the the properties of the PackageInfo objects.
      Parameters:
      is - the input stream of a bundle.
      packageInfos - a list of the information of the packages to install.
      zipEntriesMap - a map to retrieve the zipEntry for every package. This information is necessary to select the plugin to decompress.
      Throws:
      org.gvsig.installer.lib.api.execution.InstallPackageServiceException - if there is a problem reading the bundle.
    • writePackageInfo

      void writePackageInfo(File directory, org.gvsig.installer.lib.api.PackageInfo packageInfo) throws InstallerInfoFileException
      Writes the package.info file in a concrete directory.
      Parameters:
      directory - the directory.
      packageInfo - the information to write.
      Throws:
      InstallerInfoFileException - if there is any problem writing the package.info file.
    • writePackageInfoForIndex

      void writePackageInfoForIndex(File directory, org.gvsig.installer.lib.api.PackageInfo packageInfo) throws InstallerInfoFileException
      Writes the package.info file in a concrete directory to be used in a package index.
      Parameters:
      directory - the directory.
      packageInfo - the information to write.
      Throws:
      InstallerInfoFileException - if there is any problem writing the package.info file.
    • searchPackage

      InputStream searchPackage(InputStream is, String zipEntry) throws org.gvsig.installer.lib.api.execution.InstallPackageServiceException
      It search a package inside an installer file by the zip name and returns the stream in this position ready to decompres.
      Parameters:
      is - the input stream of a bundle.
      zipEntry - the name of the zip entry.
      Returns:
      the input stream ready to install.
      Throws:
      org.gvsig.installer.lib.api.execution.InstallPackageServiceException - if there is a problem reading the stream
    • readCompressedPackageInfo

      org.gvsig.installer.lib.api.PackageInfo readCompressedPackageInfo(InputStream is) throws org.gvsig.installer.lib.api.execution.InstallPackageServiceException
      It reads a compressed file and retrieve the package information.
      Parameters:
      is - the compressed file
      Returns:
      the information of the package
      Throws:
      org.gvsig.installer.lib.api.execution.InstallPackageServiceException - if there is a problem decompressing the file.
    • getDefaultSelectedPackagesIDs

      List<String> getDefaultSelectedPackagesIDs()
    • getProperties

      Properties getProperties()