Package org.gvsig.installer.lib.spi
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 TypeMethodDescriptionvoidcompressPackage(File folder, OutputStream os) Compress a plugin folder using the plugin's name as a package.voidcompressPackageIndex(File folder, OutputStream os) Compress a plugin folder using the plugin's name as a package, only with the files needed by the package index.voidcompressPackageSet(File folder, String fileName, OutputStream os) Compress a folder as a zipped package set in the given outputstream with a concrete name.voiddecompress(InputStream is, File outputDirectory) It decompress an input stream and write it on a directory.org.gvsig.installer.lib.api.PackageInfoIt reads a compressed file and retrieve the package information.voidreadPackageInfo(File directory, org.gvsig.installer.lib.api.PackageInfo installerInfo) Reads the package.info file from a directory a fills the the properties of thePackageInfoobject.voidreadPackageInfo(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 thePackageInfoobjects.voidreadPackageSetInfo(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 thePackageInfoobjects.searchPackage(InputStream is, String zipEntry) It search a package inside an installer file by the zip name and returns the stream in this position ready to decompres.voidwritePackageInfo(File directory, org.gvsig.installer.lib.api.PackageInfo packageInfo) Writes the package.info file in a concrete directory.voidwritePackageInfoForIndex(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 decompressoutputDirectory- . 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 haveos- 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 thePackageInfoobject.- Parameters:
directory- the root directory that contains the installinfo fileinstallInfo- 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.InstallPackageServiceExceptionReads the package.info file from a package set and fills the the properties of thePackageInfoobjects.- 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.InstallPackageServiceExceptionReads the package.info file from a bundle fills the the properties of thePackageInfoobjects.- 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
-
getProperties
Properties getProperties()
-