public class DefaultPackage extends Package implements java.io.Serializable
Constructor and Description |
---|
DefaultPackage(java.io.File packageHome,
PackageManager manager)
Constructs a new DefaultPackage.
|
DefaultPackage(java.io.File packageHome,
PackageManager manager,
java.util.Map<?,?> packageMetaData)
Constructs an new DefaultPackage.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
clone()
Clone this package.
|
java.util.List<Dependency> |
getBaseSystemDependency()
Gets the dependency on the base system that this package requires.
|
java.util.List<Dependency> |
getDependencies()
Get the list of packages that this package depends on.
|
java.util.List<Dependency> |
getIncompatibleDependencies()
Gets a list of installed packages that this package depends on that are
currently incompatible with this package.
|
java.util.List<Dependency> |
getIncompatibleDependencies(java.util.List<Package> packages)
Gets those packages from the supplied list that this package depends on and
are currently incompatible with this package.
|
java.util.List<Dependency> |
getMissingDependencies()
Gets a list of packages that this package depends on that are not currently
installed.
|
java.util.List<Dependency> |
getMissingDependencies(java.util.List<Package> packages)
Gets a list of packages that this package depends on that are not in the
supplied list of packages.
|
java.lang.String |
getName()
Convenience method to return the name of this package.
|
java.net.URL |
getPackageURL()
Convenience method that returns the URL to the package (i.e the provider's
URL).
|
java.util.List<Package> |
getPrecludedPackages(java.util.List<Package> packages)
Compares this package's precluded list (if any) against the list of
supplied packages.
|
void |
install()
Install this package.
|
boolean |
isCompatibleBaseSystem()
Returns true if this package is compatible with the currently installed
version of the base system.
|
boolean |
isInstalled()
Returns true if this package is already installed
|
static void |
main(java.lang.String[] args) |
void |
setPackageManager(PackageManager p)
Set the package manager for this package
|
void |
setPackageMetaDataElement(java.lang.Object key,
java.lang.Object value)
Adds a key, value pair to the meta data map.
|
java.lang.String |
toString() |
equals, getPackageMetaData, getPackageMetaDataElement, setPackageMetaData
public DefaultPackage(java.io.File packageHome, PackageManager manager, java.util.Map<?,?> packageMetaData)
packageHome
- the directory that packages are installed into.manager
- the package manager in use.packageMetaData
- A Map of package meta data for this package.public DefaultPackage(java.io.File packageHome, PackageManager manager)
packageHome
- the directory that packages are installed into.manager
- the package manager in use.public java.lang.Object clone()
public void setPackageManager(PackageManager p)
p
- the package manager to usepublic java.net.URL getPackageURL() throws java.lang.Exception
getPackageURL
in class Package
java.lang.Exception
- if the URL can't be retrieved for some reasonpublic java.lang.String getName()
public java.util.List<Dependency> getDependencies() throws java.lang.Exception
getDependencies
in class Package
java.lang.Exception
- if a problem occurs while getting the list of
dependencies.public java.util.List<Dependency> getBaseSystemDependency() throws java.lang.Exception
getBaseSystemDependency
in class Package
java.lang.Exception
- if the base system dependency can't be determined for
some reason.public java.util.List<Dependency> getMissingDependencies(java.util.List<Package> packages) throws java.lang.Exception
getMissingDependencies
in class Package
packages
- a list of packages to compare this package's dependencies
against.java.lang.Exception
- if the list of missing depenencies can't be determined
for some reason.public java.util.List<Dependency> getMissingDependencies() throws java.lang.Exception
getMissingDependencies
in class Package
java.lang.Exception
public java.util.List<Package> getPrecludedPackages(java.util.List<Package> packages) throws java.lang.Exception
getPrecludedPackages
in class Package
packages
- a list of packages to compare against those in this
package's precluded listjava.lang.Exception
- if a problem occurspublic java.util.List<Dependency> getIncompatibleDependencies(java.util.List<Package> packages) throws java.lang.Exception
getIncompatibleDependencies
in class Package
packages
- a list of packages to compare this package's dependencies
againstjava.lang.Exception
- if the list of incompatible dependencies can't be
generated for some reason.public java.util.List<Dependency> getIncompatibleDependencies() throws java.lang.Exception
getIncompatibleDependencies
in class Package
java.lang.Exception
public boolean isCompatibleBaseSystem() throws java.lang.Exception
isCompatibleBaseSystem
in class Package
java.lang.Exception
- if a problem occurs while checking compatibility.public void install() throws java.lang.Exception
public boolean isInstalled()
isInstalled
in class Package
public static void main(java.lang.String[] args)
public void setPackageMetaDataElement(java.lang.Object key, java.lang.Object value) throws java.lang.Exception
setPackageMetaDataElement
in class Package
key
- the keyvalue
- the value to addjava.lang.Exception
- if there is no meta data map to add to.public java.lang.String toString()
toString
in class java.lang.Object