public class DefaultPackage extends Package implements Serializable
| Constructor and Description |
|---|
DefaultPackage(File packageHome,
PackageManager manager)
Constructs a new DefaultPackage.
|
DefaultPackage(File packageHome,
PackageManager manager,
Map<?,?> packageMetaData)
Constructs an new DefaultPackage.
|
| Modifier and Type | Method and Description |
|---|---|
Object |
clone()
Clone this package.
|
List<Dependency> |
getBaseSystemDependency()
Gets the dependency on the base system that this package requires.
|
List<Dependency> |
getDependencies()
Get the list of packages that this package depends on.
|
List<Dependency> |
getIncompatibleDependencies()
Gets a list of installed packages that this package depends on that are
currently incompatible with this package.
|
List<Dependency> |
getIncompatibleDependencies(List<Package> packages)
Gets those packages from the supplied list that this package depends on and
are currently incompatible with this package.
|
List<Dependency> |
getMissingDependencies()
Gets a list of packages that this package depends on that are not currently
installed.
|
List<Dependency> |
getMissingDependencies(List<Package> packages)
Gets a list of packages that this package depends on that are not in the
supplied list of packages.
|
String |
getName()
Convenience method to return the name of this package.
|
URL |
getPackageURL()
Convenience method that returns the URL to the package (i.e the provider's
URL).
|
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(String[] args) |
void |
setPackageManager(PackageManager p)
Set the package manager for this package
|
void |
setPackageMetaDataElement(Object key,
Object value)
Adds a key, value pair to the meta data map.
|
String |
toString() |
equals, getPackageMetaData, getPackageMetaDataElement, setPackageMetaDatapublic DefaultPackage(File packageHome, PackageManager manager, 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(File packageHome, PackageManager manager)
packageHome - the directory that packages are installed into.manager - the package manager in use.public Object clone()
public void setPackageManager(PackageManager p)
p - the package manager to usepublic URL getPackageURL() throws Exception
getPackageURL in class PackageException - if the URL can't be retrieved for some reasonpublic String getName()
public List<Dependency> getDependencies() throws Exception
getDependencies in class PackageException - if a problem occurs while getting the list of
dependencies.public List<Dependency> getBaseSystemDependency() throws Exception
getBaseSystemDependency in class PackageException - if the base system dependency can't be determined for
some reason.public List<Dependency> getMissingDependencies(List<Package> packages) throws Exception
getMissingDependencies in class Packagepackages - a list of packages to compare this package's dependencies
against.Exception - if the list of missing depenencies can't be determined
for some reason.public List<Dependency> getMissingDependencies() throws Exception
getMissingDependencies in class PackageExceptionpublic List<Dependency> getIncompatibleDependencies(List<Package> packages) throws Exception
getIncompatibleDependencies in class Packagepackages - a list of packages to compare this package's dependencies
againstException - if the list of incompatible dependencies can't be
generated for some reason.public List<Dependency> getIncompatibleDependencies() throws Exception
getIncompatibleDependencies in class PackageExceptionpublic boolean isCompatibleBaseSystem()
throws Exception
isCompatibleBaseSystem in class PackageException - if a problem occurs while checking compatibility.public void install()
throws Exception
public boolean isInstalled()
isInstalled in class Packagepublic static void main(String[] args)
public void setPackageMetaDataElement(Object key, Object value) throws Exception
setPackageMetaDataElement in class Packagekey - the keyvalue - the value to addException - if there is no meta data map to add to.Copyright © 2016 University of Waikato, Hamilton, NZ. All Rights Reserved.