Class PackagesCache

java.lang.Object
org.gvsig.installer.lib.impl.execution.PackagesCache
All Implemented Interfaces:
Iterable<org.gvsig.installer.lib.api.PackageInfo>

public class PackagesCache extends Object implements Iterable<org.gvsig.installer.lib.api.PackageInfo>
  • Constructor Summary

    Constructors
    Constructor
    Description
    PackagesCache(org.gvsig.installer.lib.spi.InstallPackageProviderServices installerProviderServices)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addBundledPackage(org.gvsig.installer.lib.api.PackageInfo pkg, File bundleFile, String bundleEntryName)
     
    void
    addBundledPackageIndex(org.gvsig.installer.lib.api.PackageInfo pkg, File bundleFile, String bundleEntryName)
     
    void
    addPackage(org.gvsig.installer.lib.api.PackageInfo pkg, File f)
     
    void
    addPackageIndex(org.gvsig.installer.lib.api.PackageInfo pkg)
     
    boolean
    contains(org.gvsig.installer.lib.api.PackageInfo packageInfo)
     
    void
    download(org.gvsig.installer.lib.api.PackageInfo packageInfo, org.gvsig.tools.task.SimpleTaskStatus taskStatus)
     
    org.gvsig.installer.lib.api.PackageInfo
    get(int n)
     
    getFile(org.gvsig.installer.lib.api.PackageInfo packageInfo)
    Return the file associated to this package.
    getInputStream(org.gvsig.installer.lib.api.PackageInfo packageInfo)
    Return the InputStream of the package.
    boolean
    isDownloaded(org.gvsig.installer.lib.api.PackageInfo packageInfo)
     
    Iterator<org.gvsig.installer.lib.api.PackageInfo>
     
    int
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface java.lang.Iterable

    forEach, spliterator
  • Constructor Details

    • PackagesCache

      public PackagesCache(org.gvsig.installer.lib.spi.InstallPackageProviderServices installerProviderServices)
  • Method Details

    • addPackage

      public void addPackage(org.gvsig.installer.lib.api.PackageInfo pkg, File f)
    • addPackageIndex

      public void addPackageIndex(org.gvsig.installer.lib.api.PackageInfo pkg)
    • addBundledPackage

      public void addBundledPackage(org.gvsig.installer.lib.api.PackageInfo pkg, File bundleFile, String bundleEntryName)
    • addBundledPackageIndex

      public void addBundledPackageIndex(org.gvsig.installer.lib.api.PackageInfo pkg, File bundleFile, String bundleEntryName)
    • getFile

      public File getFile(org.gvsig.installer.lib.api.PackageInfo packageInfo)
      Return the file associated to this package. If the package is a standalone package it return the file of package. If the package is a standalone package index, return the file of the associated package, downloading it if need. If is a package in a bundle, return the file of the bundle.
      Parameters:
      packageInfo -
      Returns:
    • contains

      public boolean contains(org.gvsig.installer.lib.api.PackageInfo packageInfo)
    • isDownloaded

      public boolean isDownloaded(org.gvsig.installer.lib.api.PackageInfo packageInfo)
    • download

      public void download(org.gvsig.installer.lib.api.PackageInfo packageInfo, org.gvsig.tools.task.SimpleTaskStatus taskStatus)
    • getInputStream

      public InputStream getInputStream(org.gvsig.installer.lib.api.PackageInfo packageInfo)
      Return the InputStream of the package. If is a package index, download if need the package and return a InputStream of the package associated to the index. If is a package in a bundle, return a InputStream without extract the package of the bundle.
      Parameters:
      packageInfo -
      Returns:
    • iterator

      public Iterator<org.gvsig.installer.lib.api.PackageInfo> iterator()
      Specified by:
      iterator in interface Iterable<org.gvsig.installer.lib.api.PackageInfo>
    • size

      public int size()
    • get

      public org.gvsig.installer.lib.api.PackageInfo get(int n)